Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ import spaces
|
|
9 |
import torch
|
10 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
11 |
|
12 |
-
|
13 |
-
DESCRIPTION = "openthaigpt/openthaigpt-1.0.0-alpha-7b-chat-ckpt-hf"
|
14 |
|
15 |
if not torch.cuda.is_available():
|
16 |
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
@@ -20,7 +20,7 @@ DEFAULT_MAX_NEW_TOKENS = 1024
|
|
20 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
21 |
|
22 |
if torch.cuda.is_available():
|
23 |
-
model_id = "
|
24 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
25 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
26 |
|
@@ -108,11 +108,11 @@ chat_interface = gr.ChatInterface(
|
|
108 |
],
|
109 |
stop_btn=None,
|
110 |
examples=[
|
111 |
-
["
|
112 |
-
["
|
113 |
-
["
|
114 |
-
["
|
115 |
-
["
|
116 |
],
|
117 |
)
|
118 |
|
|
|
9 |
import torch
|
10 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
11 |
|
12 |
+
DESCRIPTION = "scb10x/typhoon-7b"
|
13 |
+
#DESCRIPTION = "openthaigpt/openthaigpt-1.0.0-alpha-7b-chat-ckpt-hf"
|
14 |
|
15 |
if not torch.cuda.is_available():
|
16 |
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
|
|
20 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
21 |
|
22 |
if torch.cuda.is_available():
|
23 |
+
model_id = "scb10x/typhoon-7b"
|
24 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
25 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
26 |
|
|
|
108 |
],
|
109 |
stop_btn=None,
|
110 |
examples=[
|
111 |
+
["สวัสดี"],
|
112 |
+
["วิธีลดน้ำหนัก"],
|
113 |
+
["การท่องเที่ยวทางทะเล"],
|
114 |
+
["เขียนภาษา html"],
|
115 |
+
["เขียนบทความ 100 คำใน 'Benefits of Open-Source in AI research'"],
|
116 |
],
|
117 |
)
|
118 |
|