KVAkash commited on
Commit
76f59e7
1 Parent(s): 703cbc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -101,16 +101,6 @@ class HallucinationMitigator:
101
  except Exception as e:
102
  return f"Error generating text: {str(e)}"
103
 
104
- def find_free_port():
105
- """
106
- Find a free port to use
107
- """
108
- with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
109
- s.bind(('', 0))
110
- s.listen(1)
111
- port = s.getsockname()[1]
112
- return port
113
-
114
  def create_gradio_interface():
115
  """
116
  Create Gradio interface for text generation.
@@ -134,7 +124,8 @@ def create_gradio_interface():
134
  def main():
135
  # Create the interface
136
  interface = create_gradio_interface()
137
- # Only specify server_name, Gradio will choose a port automatically
 
138
  interface.launch(server_name='0.0.0.0')
139
 
140
  if __name__ == "__main__":
 
101
  except Exception as e:
102
  return f"Error generating text: {str(e)}"
103
 
 
 
 
 
 
 
 
 
 
 
104
  def create_gradio_interface():
105
  """
106
  Create Gradio interface for text generation.
 
124
  def main():
125
  # Create the interface
126
  interface = create_gradio_interface()
127
+
128
+ # Launch Gradio app (no manual port or server specified)
129
  interface.launch(server_name='0.0.0.0')
130
 
131
  if __name__ == "__main__":