alanchen1115 commited on
Commit
168dae6
·
verified ·
1 Parent(s): f274a3f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +15 -16
main.py CHANGED
@@ -24,25 +24,24 @@ app.add_middleware(
24
  allow_methods=["*"],
25
  allow_headers=["*"],
26
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  @app.get("/")
29
  def root():
30
- def get_gemini_response(input):
31
- response = model.generate_content(input, generation_config=generation_config)
32
- return response.text
33
- # Define the Gradio interface
34
- iface = gr.Interface(
35
- fn=get_gemini_response,
36
- inputs=[
37
- gr.Textbox(label="Enter your question here:"),
38
- ],
39
- outputs=gr.Textbox(label="The response is"),
40
- title="Gemini Bot",
41
- description="Ask Gemini!!!",
42
- )
43
- # Launch the Gradio interface
44
- iface.launch()
45
-
46
  return {"title": "Line Bot"}
47
 
48
  @app.post("/webhook")
 
24
  allow_methods=["*"],
25
  allow_headers=["*"],
26
  )
27
+ def get_gemini_response(input):
28
+ response = model.generate_content(input, generation_config=generation_config)
29
+ return response.text
30
+ # Define the Gradio interface
31
+ iface = gr.Interface(
32
+ fn=get_gemini_response,
33
+ inputs=[
34
+ gr.Textbox(label="Enter your question here:"),
35
+ ],
36
+ outputs=gr.Textbox(label="The response is"),
37
+ title="Gemini Bot",
38
+ description="Ask Gemini!!!",
39
+ )
40
+ # Launch the Gradio interface
41
+ iface.launch()
42
 
43
  @app.get("/")
44
  def root():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  return {"title": "Line Bot"}
46
 
47
  @app.post("/webhook")