Spaces:
Running
on
Zero
Running
on
Zero
MohamedRashad
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
2 |
import torch
|
3 |
import gradio as gr
|
@@ -23,7 +24,7 @@ terminators = [
|
|
23 |
tokenizer.convert_tokens_to_ids("<|eot_id|>"),
|
24 |
]
|
25 |
|
26 |
-
|
27 |
def generate_both(system_prompt, input_text, base_chatbot, new_chatbot):
|
28 |
base_text_streamer = TextIteratorStreamer(tokenizer, skip_prompt=True)
|
29 |
new_text_streamer = TextIteratorStreamer(tokenizer, skip_prompt=True)
|
|
|
1 |
+
import spaces
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
3 |
import torch
|
4 |
import gradio as gr
|
|
|
24 |
tokenizer.convert_tokens_to_ids("<|eot_id|>"),
|
25 |
]
|
26 |
|
27 |
+
@spaces.GPU(duration=120)
|
28 |
def generate_both(system_prompt, input_text, base_chatbot, new_chatbot):
|
29 |
base_text_streamer = TextIteratorStreamer(tokenizer, skip_prompt=True)
|
30 |
new_text_streamer = TextIteratorStreamer(tokenizer, skip_prompt=True)
|