mgokg commited on
Commit
51f5b3e
·
verified ·
1 Parent(s): 074f881

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -17
app.py CHANGED
@@ -35,20 +35,7 @@ def predict(prompt):
35
  )
36
 
37
  chat_session = model.start_chat(
38
- history=[
39
- {
40
- "role": "user",
41
- "parts": [
42
- "return a json object with the contact details. leave blank if information is not available. here is the json schema:\n\n{\n \"organization\": \"\",\n \"address\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"website\": \"\"\n}\n\nyou can find the contact details here: \nImpressum – Aero-Club Bamberg e.V.\nAero-Club Bamberg\nhttps://aeroclub-bamberg.de › impressum\nAero-Club Bamberg e.V.. Zeppelinstraße 18. D-96052 Bamberg. Tel.: 0951 / 45 1 45. Fax: 0951 / 13 22 20. E-Mail: [email protected].\n",
43
- ],
44
- },
45
- {
46
- "role": "model",
47
- "parts": [
48
- "```json\n{\n \"organization\": \"Aero-Club Bamberg e.V.\",\n \"address\": \"Zeppelinstraße 18, D-96052 Bamberg\",\n \"phone\": \"0951 / 45 1 45\",\n \"email\": \"[email protected]\",\n \"website\": \"https://aeroclub-bamberg.de\"\n}\n```\n",
49
- ],
50
- },
51
- ]
52
  )
53
 
54
  response = chat_session.send_message("return a json object with the contact details. leave blank if information is not available. here is the json schema:\n\n{\n \"organization\": \"\",\n \"address\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"website\": \"\"\n}\n\nyou can find the contact details here: \n" + prompt)
@@ -93,8 +80,6 @@ def websearch(prompt):
93
  print("Kein div mit der Klasse 'MjjYud' gefunden.")
94
  return None
95
 
96
-
97
-
98
  # Create the Gradio interface
99
  with gr.Blocks(css=custom_css) as demo:
100
  with gr.Row():
@@ -106,7 +91,7 @@ with gr.Blocks(css=custom_css) as demo:
106
  button = gr.Button("Senden")
107
 
108
  # Connect the button to the function
109
- button.click(fn=get_impressum_text, inputs=ort_input, outputs=details_output)
110
 
111
  # Launch the Gradio application
112
  demo.launch()
 
35
  )
36
 
37
  chat_session = model.start_chat(
38
+ history=[]
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  )
40
 
41
  response = chat_session.send_message("return a json object with the contact details. leave blank if information is not available. here is the json schema:\n\n{\n \"organization\": \"\",\n \"address\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"website\": \"\"\n}\n\nyou can find the contact details here: \n" + prompt)
 
80
  print("Kein div mit der Klasse 'MjjYud' gefunden.")
81
  return None
82
 
 
 
83
  # Create the Gradio interface
84
  with gr.Blocks(css=custom_css) as demo:
85
  with gr.Row():
 
91
  button = gr.Button("Senden")
92
 
93
  # Connect the button to the function
94
+ button.click(fn=predict, inputs=ort_input, outputs=details_output)
95
 
96
  # Launch the Gradio application
97
  demo.launch()