Spaces:
Sleeping
Sleeping
sadidul012
commited on
Commit
•
91b50f7
1
Parent(s):
b0c4c14
big text
Browse files
app.py
CHANGED
@@ -32,15 +32,14 @@ graph_config = {
|
|
32 |
|
33 |
|
34 |
def scrape_and_summarize(prompt, source):
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
# return result, prettify_exec_info(exec_info)
|
44 |
|
45 |
|
46 |
# Gradio interface
|
@@ -54,8 +53,7 @@ with gr.Blocks() as demo:
|
|
54 |
with gr.Column():
|
55 |
model_dropdown = gr.Textbox(label="Model", value="Mistral-7B-Instruct-v0.2")
|
56 |
prompt_input = gr.Textbox(label="Prompt", value="List me all the press releases with their headlines and urls.")
|
57 |
-
|
58 |
-
file_input = gr.Interface(inputs=["file",], outputs="text")
|
59 |
scrape_button = gr.Button("Scrape and Summarize")
|
60 |
|
61 |
with gr.Column():
|
@@ -64,7 +62,7 @@ with gr.Blocks() as demo:
|
|
64 |
|
65 |
scrape_button.click(
|
66 |
scrape_and_summarize,
|
67 |
-
inputs=[prompt_input,
|
68 |
outputs=[result_output, exec_info_output]
|
69 |
)
|
70 |
|
|
|
32 |
|
33 |
|
34 |
def scrape_and_summarize(prompt, source):
|
35 |
+
smart_scraper_graph = SmartScraperGraph(
|
36 |
+
prompt=prompt,
|
37 |
+
source=source,
|
38 |
+
config=graph_config
|
39 |
+
)
|
40 |
+
result = smart_scraper_graph.run()
|
41 |
+
exec_info = smart_scraper_graph.get_execution_info()
|
42 |
+
return result, prettify_exec_info(exec_info)
|
|
|
43 |
|
44 |
|
45 |
# Gradio interface
|
|
|
53 |
with gr.Column():
|
54 |
model_dropdown = gr.Textbox(label="Model", value="Mistral-7B-Instruct-v0.2")
|
55 |
prompt_input = gr.Textbox(label="Prompt", value="List me all the press releases with their headlines and urls.")
|
56 |
+
source_input = gr.Textbox(label="HTML", value="html")
|
|
|
57 |
scrape_button = gr.Button("Scrape and Summarize")
|
58 |
|
59 |
with gr.Column():
|
|
|
62 |
|
63 |
scrape_button.click(
|
64 |
scrape_and_summarize,
|
65 |
+
inputs=[prompt_input, source_input],
|
66 |
outputs=[result_output, exec_info_output]
|
67 |
)
|
68 |
|