Spaces:
Running
Running
shaocongma
commited on
Commit
•
b730fc0
1
Parent(s):
74b040a
Update proxy.
Browse files- app.py +0 -2
- utils/references.py +3 -2
app.py
CHANGED
@@ -115,8 +115,6 @@ with gr.Blocks(theme=theme) as demo:
|
|
115 |
***2023-05-17 Update***: 我的API的余额用完了, 所以这个月不再能提供GPT-4的API Key. 这里为大家提供了一个位置输入OpenAI API Key. 同时也提供了GPT-3.5的兼容. 欢迎大家自行体验.
|
116 |
|
117 |
如果有更多想法和建议欢迎加入QQ群里交流, 如果我在Space里更新了Key我会第一时间通知大家. 群号: ***249738228***.
|
118 |
-
|
119 |
-
请注意不要在`Cache`显示AVAILABLE的时候输入你的Key, 因为会被上传到我的云储存里.
|
120 |
''')
|
121 |
|
122 |
with gr.Row():
|
|
|
115 |
***2023-05-17 Update***: 我的API的余额用完了, 所以这个月不再能提供GPT-4的API Key. 这里为大家提供了一个位置输入OpenAI API Key. 同时也提供了GPT-3.5的兼容. 欢迎大家自行体验.
|
116 |
|
117 |
如果有更多想法和建议欢迎加入QQ群里交流, 如果我在Space里更新了Key我会第一时间通知大家. 群号: ***249738228***.
|
|
|
|
|
118 |
''')
|
119 |
|
120 |
with gr.Row():
|
utils/references.py
CHANGED
@@ -40,14 +40,15 @@ def remove_newlines(serie):
|
|
40 |
|
41 |
def search_paper_abstract(title):
|
42 |
pg = ProxyGenerator()
|
43 |
-
success = pg.ScraperAPI("921b16f94d701308b9d9b4456ddde155")
|
44 |
if success:
|
45 |
scholarly.use_proxy(pg)
|
46 |
# input the title of a paper, return its abstract
|
47 |
search_query = scholarly.search_pubs(title)
|
48 |
found_paper = next(search_query)
|
49 |
else:
|
50 |
-
|
|
|
51 |
return remove_newlines(found_paper['bib']['abstract'])
|
52 |
|
53 |
|
|
|
40 |
|
41 |
def search_paper_abstract(title):
|
42 |
pg = ProxyGenerator()
|
43 |
+
success = pg.FreeProxies() #pg.ScraperAPI("921b16f94d701308b9d9b4456ddde155")
|
44 |
if success:
|
45 |
scholarly.use_proxy(pg)
|
46 |
# input the title of a paper, return its abstract
|
47 |
search_query = scholarly.search_pubs(title)
|
48 |
found_paper = next(search_query)
|
49 |
else:
|
50 |
+
return ""
|
51 |
+
# raise RuntimeError("ScraperAPI fails.")
|
52 |
return remove_newlines(found_paper['bib']['abstract'])
|
53 |
|
54 |
|