Spaces:
Sleeping
Sleeping
alfredplpl
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import gradio as gr
|
|
4 |
import os
|
5 |
import spaces
|
6 |
import torch
|
7 |
-
from transformers import
|
8 |
from threading import Thread
|
9 |
|
10 |
DESCRIPTION = '''
|
@@ -45,7 +45,7 @@ h1 {
|
|
45 |
|
46 |
# Load the tokenizer and model
|
47 |
tokenizer = AutoTokenizer.from_pretrained("alfredplpl/sarashina2-7b-it")
|
48 |
-
model =
|
49 |
model=model.to("cuda:0")
|
50 |
|
51 |
@spaces.GPU()
|
|
|
4 |
import os
|
5 |
import spaces
|
6 |
import torch
|
7 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
8 |
from threading import Thread
|
9 |
|
10 |
DESCRIPTION = '''
|
|
|
45 |
|
46 |
# Load the tokenizer and model
|
47 |
tokenizer = AutoTokenizer.from_pretrained("alfredplpl/sarashina2-7b-it")
|
48 |
+
model = AutoModelForCausalLM.from_pretrained("alfredplpl/sarashina2-7b-it", torch_dtype=torch.bfloat16)
|
49 |
model=model.to("cuda:0")
|
50 |
|
51 |
@spaces.GPU()
|