Spaces:
Running
on
Zero
Running
on
Zero
BramVanroy
commited on
Commit
•
f305ee8
1
Parent(s):
04caf55
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from typing import Iterator
|
|
6 |
import torch
|
7 |
|
8 |
import gradio as gr
|
9 |
-
|
10 |
import torch
|
11 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
12 |
|
@@ -21,7 +21,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_id)
|
|
21 |
tokenizer.pad_token_id = tokenizer.eos_token_id
|
22 |
|
23 |
|
24 |
-
|
25 |
def generate(
|
26 |
message: str,
|
27 |
chat_history: list[tuple[str, str]],
|
|
|
6 |
import torch
|
7 |
|
8 |
import gradio as gr
|
9 |
+
import spaces
|
10 |
import torch
|
11 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
12 |
|
|
|
21 |
tokenizer.pad_token_id = tokenizer.eos_token_id
|
22 |
|
23 |
|
24 |
+
@spaces.GPU
|
25 |
def generate(
|
26 |
message: str,
|
27 |
chat_history: list[tuple[str, str]],
|