alfredplpl
commited on
Commit
•
1637de0
1
Parent(s):
2c778fe
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import os
|
|
6 |
from transformers import GemmaTokenizer, AutoModelForCausalLM
|
7 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
8 |
from threading import Thread
|
9 |
-
|
10 |
|
11 |
DESCRIPTION = '''
|
12 |
<div>
|
@@ -45,8 +45,8 @@ h1 {
|
|
45 |
"""
|
46 |
|
47 |
# Load the tokenizer and model
|
48 |
-
tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-3-13b-instruct")
|
49 |
-
model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3-13b-instruct", device_map="auto")
|
50 |
|
51 |
@spaces.GPU()
|
52 |
def chat_llama3_8b(message: str,
|
|
|
6 |
from transformers import GemmaTokenizer, AutoModelForCausalLM
|
7 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
8 |
from threading import Thread
|
9 |
+
import torch
|
10 |
|
11 |
DESCRIPTION = '''
|
12 |
<div>
|
|
|
45 |
"""
|
46 |
|
47 |
# Load the tokenizer and model
|
48 |
+
tokenizer = AutoTokenizer.from_pretrained("llm-jp/llm-jp-3-13b-instruct", torch_dtype=torch.bfloat16)
|
49 |
+
model = AutoModelForCausalLM.from_pretrained("llm-jp/llm-jp-3-13b-instruct", torch_dtype=torch.bfloat16,device_map="auto")
|
50 |
|
51 |
@spaces.GPU()
|
52 |
def chat_llama3_8b(message: str,
|