Uhhy commited on
Commit
365f24d
1 Parent(s): a07b36b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -5,6 +5,7 @@ import re
5
  import httpx
6
  import asyncio
7
  import gradio as gr
 
8
 
9
  global_data = {
10
  'models': {},
@@ -81,7 +82,6 @@ def remove_duplicates(text):
81
  seen_lines.add(line)
82
  return '\n'.join(unique_lines)
83
 
84
-
85
  def generate_model_response(model, inputs):
86
  try:
87
  response = model(inputs)
@@ -126,4 +126,6 @@ iface = gr.Interface(
126
  description="Enter a message and get responses from multiple LLMs.",
127
  )
128
 
129
- iface.launch(server_port=7860)
 
 
 
5
  import httpx
6
  import asyncio
7
  import gradio as gr
8
+ import os
9
 
10
  global_data = {
11
  'models': {},
 
82
  seen_lines.add(line)
83
  return '\n'.join(unique_lines)
84
 
 
85
  def generate_model_response(model, inputs):
86
  try:
87
  response = model(inputs)
 
126
  description="Enter a message and get responses from multiple LLMs.",
127
  )
128
 
129
+ if __name__ == "__main__":
130
+ port = int(os.environ.get("PORT", 7860))
131
+ iface.launch(server_port=port)