mgokg commited on
Commit
0da9415
·
verified ·
1 Parent(s): 3c3db31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -18
app.py CHANGED
@@ -43,27 +43,21 @@ async def read_index():
43
  def read_root():
44
  return {"message": "Willkommen am Root-Endpunkt."}
45
 
46
- if __name__ == "__main__":
47
- # Starte Gradio in einem separaten Thread
48
- threading.Thread(target=start_gradio).start()
49
- uvicorn.run(app, host="0.0.0.0", port=8000)
50
-
 
 
 
51
 
52
- def start_gradio():
53
- with gr.Blocks() as demo:
54
- gr.IFrame(src="http://localhost:8000/fa.html", width="100%", height="600px")
55
- with gr.Row():
56
- details_output = gr.Textbox(label="Ausgabe")
57
- with gr.Row():
58
- ort_input = gr.Textbox(label="", placeholder="ask anything...")
59
- with gr.Row():
60
- button = gr.Button("Senden")
61
 
62
- # Connect the button to the function
63
- button.click(fn=get_prompt, inputs=ort_input, outputs=details_output)
64
 
65
- # Launch the Gradio application
66
- demo.launch()
67
 
68
  if __name__ == "__main__":
69
  # Starte Gradio in einem separaten Thread
 
43
  def read_root():
44
  return {"message": "Willkommen am Root-Endpunkt."}
45
 
46
+ with gr.Blocks() as demo:
47
+ gr.IFrame(src="http://localhost:8000/fa.html", width="100%", height="600px")
48
+ with gr.Row():
49
+ details_output = gr.Textbox(label="Ausgabe")
50
+ with gr.Row():
51
+ ort_input = gr.Textbox(label="", placeholder="ask anything...")
52
+ with gr.Row():
53
+ button = gr.Button("Senden")
54
 
55
+ # Connect the button to the function
56
+ button.click(fn=get_prompt, inputs=ort_input, outputs=details_output)
 
 
 
 
 
 
 
57
 
58
+ # Launch the Gradio application
59
+ demo.launch()
60
 
 
 
61
 
62
  if __name__ == "__main__":
63
  # Starte Gradio in einem separaten Thread