Spaces:
Runtime error
Runtime error
root
commited on
Commit
·
3692eb0
1
Parent(s):
858bdfa
updatespacesgpuparams
Browse files
app.py
CHANGED
@@ -99,7 +99,7 @@ def update_remote_config(remote_ornot,remote_company = None,api = None,model = N
|
|
99 |
pytoml.dump(config, f)
|
100 |
return gr.Button("配置已保存")
|
101 |
|
102 |
-
# @spaces.GPU(duration=
|
103 |
def get_ready(query:str,chunksize=None,k=None):
|
104 |
|
105 |
with open(CONFIG_PATH, encoding='utf8') as f:
|
@@ -244,7 +244,7 @@ def update_database_info():
|
|
244 |
|
245 |
return new_options, jsonobj
|
246 |
|
247 |
-
@spaces.GPU(duration=
|
248 |
def generate_database(chunksize:int,nclusters:str|list[str]):
|
249 |
# 在这里运行生成数据库的函数
|
250 |
repodir, workdir, _ = get_ready('repo_work')
|
@@ -297,7 +297,7 @@ def update_ncluster_dropdown(chunksize:int):
|
|
297 |
nclusters = jsonobj[chunksize]
|
298 |
return gr.Dropdown(choices= nclusters)
|
299 |
|
300 |
-
# @spaces.GPU(duration=
|
301 |
def annotation(n,chunksize:int,nclusters:int,remote_ornot:bool):
|
302 |
'''
|
303 |
use llm to annotate cluster
|
@@ -337,7 +337,7 @@ def annotation(n,chunksize:int,nclusters:int,remote_ornot:bool):
|
|
337 |
|
338 |
return '\n\n'.join([obj['annotation'] for obj in new_obj_list])
|
339 |
|
340 |
-
# @spaces.GPU(duration=
|
341 |
def inspiration(annotation:str,chunksize:int,nclusters:int,remote_ornot:bool):
|
342 |
query = 'inspiration'
|
343 |
if remote_ornot:
|
@@ -386,7 +386,7 @@ def getpmcurls(references):
|
|
386 |
urls.append(ref)
|
387 |
return urls
|
388 |
|
389 |
-
@spaces.GPU(duration=
|
390 |
def summarize_text(query,chunksize:int,remote_ornot:bool):
|
391 |
if remote_ornot:
|
392 |
backend = 'remote'
|
|
|
99 |
pytoml.dump(config, f)
|
100 |
return gr.Button("配置已保存")
|
101 |
|
102 |
+
# @spaces.GPU(duration=120)
|
103 |
def get_ready(query:str,chunksize=None,k=None):
|
104 |
|
105 |
with open(CONFIG_PATH, encoding='utf8') as f:
|
|
|
244 |
|
245 |
return new_options, jsonobj
|
246 |
|
247 |
+
@spaces.GPU(duration=120)
|
248 |
def generate_database(chunksize:int,nclusters:str|list[str]):
|
249 |
# 在这里运行生成数据库的函数
|
250 |
repodir, workdir, _ = get_ready('repo_work')
|
|
|
297 |
nclusters = jsonobj[chunksize]
|
298 |
return gr.Dropdown(choices= nclusters)
|
299 |
|
300 |
+
# @spaces.GPU(duration=120)
|
301 |
def annotation(n,chunksize:int,nclusters:int,remote_ornot:bool):
|
302 |
'''
|
303 |
use llm to annotate cluster
|
|
|
337 |
|
338 |
return '\n\n'.join([obj['annotation'] for obj in new_obj_list])
|
339 |
|
340 |
+
# @spaces.GPU(duration=120)
|
341 |
def inspiration(annotation:str,chunksize:int,nclusters:int,remote_ornot:bool):
|
342 |
query = 'inspiration'
|
343 |
if remote_ornot:
|
|
|
386 |
urls.append(ref)
|
387 |
return urls
|
388 |
|
389 |
+
@spaces.GPU(duration=120)
|
390 |
def summarize_text(query,chunksize:int,remote_ornot:bool):
|
391 |
if remote_ornot:
|
392 |
backend = 'remote'
|