Spaces:
Runtime error
Runtime error
SyrWin
commited on
Commit
•
3468330
1
Parent(s):
f183255
updated @spaces.GPU
Browse files- app.py +2 -0
- requirements.txt +1 -0
app.py
CHANGED
@@ -12,6 +12,7 @@ from model.blip2_model import Blip2Model
|
|
12 |
from data_provider.data_utils import json_read, json_write
|
13 |
from data_provider.data_utils import smiles2data, reformat_smiles
|
14 |
import gradio as gr
|
|
|
15 |
from datetime import datetime
|
16 |
|
17 |
## for pyg bug
|
@@ -194,6 +195,7 @@ class InferenceRunner:
|
|
194 |
return graph_list, input_text
|
195 |
|
196 |
@torch.no_grad()
|
|
|
197 |
def predict(self, rxn_dict, temperature=1):
|
198 |
graphs, prompt_tokens = self.tokenize(rxn_dict)
|
199 |
result_dict = rxn_dict
|
|
|
12 |
from data_provider.data_utils import json_read, json_write
|
13 |
from data_provider.data_utils import smiles2data, reformat_smiles
|
14 |
import gradio as gr
|
15 |
+
import space
|
16 |
from datetime import datetime
|
17 |
|
18 |
## for pyg bug
|
|
|
195 |
return graph_list, input_text
|
196 |
|
197 |
@torch.no_grad()
|
198 |
+
@spaces.GPU
|
199 |
def predict(self, rxn_dict, temperature=1):
|
200 |
graphs, prompt_tokens = self.tokenize(rxn_dict)
|
201 |
result_dict = rxn_dict
|
requirements.txt
CHANGED
@@ -11,4 +11,5 @@ rouge_score
|
|
11 |
salesforce-lavis
|
12 |
textdistance
|
13 |
gradio
|
|
|
14 |
torch_ema
|
|
|
11 |
salesforce-lavis
|
12 |
textdistance
|
13 |
gradio
|
14 |
+
space
|
15 |
torch_ema
|