Spaces:
Running
on
Zero
Running
on
Zero
BramVanroy
commited on
Commit
•
67aaf8c
1
Parent(s):
87fdd2e
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 |
|
@@ -20,7 +20,7 @@ if torch.cuda.is_available():
|
|
20 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
21 |
|
22 |
|
23 |
-
|
24 |
def generate(
|
25 |
message: str,
|
26 |
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 |
|
|
|
20 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
21 |
|
22 |
|
23 |
+
@spaces.GPU
|
24 |
def generate(
|
25 |
message: str,
|
26 |
chat_history: list[tuple[str, str]],
|