Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import os
|
2 |
import time
|
|
|
3 |
|
4 |
import gradio as gr
|
5 |
import argparse
|
@@ -72,7 +73,7 @@ def highlight_text(text, text_list,color="black"):
|
|
72 |
|
73 |
return result
|
74 |
|
75 |
-
|
76 |
def warmup(model):
|
77 |
conv = get_conversation_template(args.model_type)
|
78 |
|
@@ -92,7 +93,7 @@ def warmup(model):
|
|
92 |
input_ids = torch.as_tensor(input_ids).cuda()
|
93 |
for output_ids in model.ea_generate(input_ids):
|
94 |
ol=output_ids.shape[1]
|
95 |
-
|
96 |
def bot(history, temperature, top_p, use_EaInfer, highlight_EaInfer,session_state,):
|
97 |
if not history:
|
98 |
return history, "0.00 tokens/s", "0.00", session_state
|
|
|
1 |
import os
|
2 |
import time
|
3 |
+
import spaces
|
4 |
|
5 |
import gradio as gr
|
6 |
import argparse
|
|
|
73 |
|
74 |
return result
|
75 |
|
76 |
+
@spaces.GPU
|
77 |
def warmup(model):
|
78 |
conv = get_conversation_template(args.model_type)
|
79 |
|
|
|
93 |
input_ids = torch.as_tensor(input_ids).cuda()
|
94 |
for output_ids in model.ea_generate(input_ids):
|
95 |
ol=output_ids.shape[1]
|
96 |
+
@spaces.GPU
|
97 |
def bot(history, temperature, top_p, use_EaInfer, highlight_EaInfer,session_state,):
|
98 |
if not history:
|
99 |
return history, "0.00 tokens/s", "0.00", session_state
|