Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
-
import spaces
|
5 |
|
6 |
model_name = "MBZUAI-Paris/Atlas-Chat-9B"
|
7 |
dtype = torch.bfloat16
|
@@ -13,7 +13,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
14 |
|
15 |
|
16 |
-
|
17 |
def chat(input_text, history=[]):
|
18 |
# Tokenize the input and generate response
|
19 |
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
+
#import spaces
|
5 |
|
6 |
model_name = "MBZUAI-Paris/Atlas-Chat-9B"
|
7 |
dtype = torch.bfloat16
|
|
|
13 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
14 |
|
15 |
|
16 |
+
#@spaces.GPU
|
17 |
def chat(input_text, history=[]):
|
18 |
# Tokenize the input and generate response
|
19 |
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
|