Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import sys
|
|
| 4 |
import html
|
| 5 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
|
| 6 |
from threading import Thread
|
|
|
|
| 7 |
|
| 8 |
model_name_or_path = 'TencentARC/Mistral_Pro_8B_v0.1'
|
| 9 |
|
|
@@ -46,6 +47,7 @@ def convert_history(chat_history, max_input_length=1024):
|
|
| 46 |
history_text = "<|assistant|>\n"
|
| 47 |
return history_text
|
| 48 |
|
|
|
|
| 49 |
@torch.inference_mode()
|
| 50 |
def instruct(instruction, max_token_output=1024):
|
| 51 |
input_text = instruction
|
|
|
|
| 4 |
import html
|
| 5 |
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
|
| 6 |
from threading import Thread
|
| 7 |
+
import spaces
|
| 8 |
|
| 9 |
model_name_or_path = 'TencentARC/Mistral_Pro_8B_v0.1'
|
| 10 |
|
|
|
|
| 47 |
history_text = "<|assistant|>\n"
|
| 48 |
return history_text
|
| 49 |
|
| 50 |
+
@spaces.GPU
|
| 51 |
@torch.inference_mode()
|
| 52 |
def instruct(instruction, max_token_output=1024):
|
| 53 |
input_text = instruction
|