Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,7 @@ import os
|
|
12 |
api_key = os.environ.get('groq')
|
13 |
read_key = os.environ.get('HF_TOKEN', None)
|
14 |
client = groq.Client(api_key=api_key)
|
|
|
15 |
# Use Llama 3 70B powered by Groq for answering
|
16 |
def ask_llm(ort):
|
17 |
|
@@ -106,8 +107,9 @@ with gr.Blocks() as demo:
|
|
106 |
gr.Markdown("# ")
|
107 |
with gr.Row():
|
108 |
ort_input = gr.Textbox(label="Ort", placeholder="Gib den Namen des Ortes ein")
|
109 |
-
|
110 |
-
|
|
|
111 |
#links_output = gr.DataFrame(label="Ergebnisse")
|
112 |
#json_output = gr.JSON(label="Ergebnisse")
|
113 |
|
@@ -116,7 +118,7 @@ with gr.Blocks() as demo:
|
|
116 |
#antwort=gr.Markdown()
|
117 |
#return antwort
|
118 |
links = parse_links_and_content(ort)
|
119 |
-
|
120 |
contact= scrape_links(links)
|
121 |
json_data = [json.loads(item) for item in contact]
|
122 |
#save_to_csv(json_data, './contact_details.csv')
|
@@ -130,7 +132,7 @@ with gr.Blocks() as demo:
|
|
130 |
button = gr.Button("senden")
|
131 |
|
132 |
# Verbinde den Button mit der Funktion
|
133 |
-
button.click(fn=
|
134 |
|
135 |
# Starte die Gradio-Anwendung
|
136 |
demo.launch()
|
|
|
12 |
api_key = os.environ.get('groq')
|
13 |
read_key = os.environ.get('HF_TOKEN', None)
|
14 |
client = groq.Client(api_key=api_key)
|
15 |
+
|
16 |
# Use Llama 3 70B powered by Groq for answering
|
17 |
def ask_llm(ort):
|
18 |
|
|
|
107 |
gr.Markdown("# ")
|
108 |
with gr.Row():
|
109 |
ort_input = gr.Textbox(label="Ort", placeholder="Gib den Namen des Ortes ein")
|
110 |
+
with gr.Row():
|
111 |
+
links_output = gr.Textbox(label="Antwort")
|
112 |
+
rechts_output = gr.Textbox(label="Antwort")
|
113 |
#links_output = gr.DataFrame(label="Ergebnisse")
|
114 |
#json_output = gr.JSON(label="Ergebnisse")
|
115 |
|
|
|
118 |
#antwort=gr.Markdown()
|
119 |
#return antwort
|
120 |
links = parse_links_and_content(ort)
|
121 |
+
return links
|
122 |
contact= scrape_links(links)
|
123 |
json_data = [json.loads(item) for item in contact]
|
124 |
#save_to_csv(json_data, './contact_details.csv')
|
|
|
132 |
button = gr.Button("senden")
|
133 |
|
134 |
# Verbinde den Button mit der Funktion
|
135 |
+
button.click(fn=parse_links_and_content, inputs=ort_input, outputs=[links_output, rechts_output])
|
136 |
|
137 |
# Starte die Gradio-Anwendung
|
138 |
demo.launch()
|