sadidul012 commited on
Commit
15cb8f8
1 Parent(s): 7e92f73
Files changed (2) hide show
  1. app.py +12 -10
  2. test.py +1 -1
app.py CHANGED
@@ -37,16 +37,18 @@ def scrape_and_summarize(prompt, source):
37
  with open("file.txt", "w") as file:
38
  file.write(html.unescape(source))
39
 
40
- # return {"prompt": prompt}, {"source": source}
41
- smart_scraper_graph = SmartScraperGraph(
42
- prompt=prompt,
43
- source="file.txt",
44
- # source=source,
45
- config=graph_config
46
- )
47
- result = smart_scraper_graph.run()
48
- exec_info = smart_scraper_graph.get_execution_info()
49
- return result, prettify_exec_info(exec_info)
 
 
50
 
51
 
52
  # Gradio interface
 
37
  with open("file.txt", "w") as file:
38
  file.write(html.unescape(source))
39
 
40
+ with open("file.txt", "r") as file:
41
+ text = file.read()
42
+ return {"prompt": prompt}, {"source": text}
43
+ # smart_scraper_graph = SmartScraperGraph(
44
+ # prompt=prompt,
45
+ # source="file.txt",
46
+ # # source=source,
47
+ # config=graph_config
48
+ # )
49
+ # result = smart_scraper_graph.run()
50
+ # exec_info = smart_scraper_graph.get_execution_info()
51
+ # return result, prettify_exec_info(exec_info)
52
 
53
 
54
  # Gradio interface
test.py CHANGED
@@ -1,7 +1,7 @@
1
  from gradio_client import Client
2
  import html
3
 
4
- with open("/home/sadid-dl/html.txt", "r") as file:
5
  text = file.read()
6
 
7
  client = Client("sadidul012/test-space")
 
1
  from gradio_client import Client
2
  import html
3
 
4
+ with open("file.txt", "r") as file:
5
  text = file.read()
6
 
7
  client = Client("sadidul012/test-space")