vilarin commited on
Commit
ae90620
1 Parent(s): 6bc1674

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import os
2
- import threading
3
  import time
4
- import subprocess
5
  import torch
6
  from transformers import AutoModelForCausalLM, AutoTokenizer
7
  import gradio as gr
@@ -43,8 +43,8 @@ tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
43
 
44
  model = model.eval()
45
 
46
- def stream_chat(message: str, history: list, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
47
-
48
  conversation = []
49
  for prompt, answer in history:
50
  conversation.extend([
 
1
  import os
2
+ import threading as Thread
3
  import time
4
+ import spaces
5
  import torch
6
  from transformers import AutoModelForCausalLM, AutoTokenizer
7
  import gradio as gr
 
43
 
44
  model = model.eval()
45
 
46
+ @spaces.GPU()
47
+ def stream_chat(message: str, history: list, temperature: float, max_new_tokens: int, top_p: float, top_k: int, penalty: float):
48
  conversation = []
49
  for prompt, answer in history:
50
  conversation.extend([