Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ model_name = "TheBloke/MythoMax-L2-13B-GPTQ"
|
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.float16)
|
| 9 |
|
|
|
|
| 10 |
def chat_with_xiaoying(user_input):
|
| 11 |
# Tokenize ็จๆท่พๅ
ฅ
|
| 12 |
inputs = tokenizer(user_input, return_tensors="pt").to(model.device)
|
|
@@ -17,6 +18,6 @@ def chat_with_xiaoying(user_input):
|
|
| 17 |
|
| 18 |
return generated_text
|
| 19 |
|
| 20 |
-
# ่ฎพ็ฝฎGradio็้ข
|
| 21 |
iface = gr.Interface(fn=chat_with_xiaoying, inputs="text", outputs="text")
|
| 22 |
iface.launch()
|
|
|
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.float16)
|
| 9 |
|
| 10 |
+
# ๅฎไนๅฏน่ฏๅฝๆฐ
|
| 11 |
def chat_with_xiaoying(user_input):
|
| 12 |
# Tokenize ็จๆท่พๅ
ฅ
|
| 13 |
inputs = tokenizer(user_input, return_tensors="pt").to(model.device)
|
|
|
|
| 18 |
|
| 19 |
return generated_text
|
| 20 |
|
| 21 |
+
# ่ฎพ็ฝฎ Gradio ็้ข
|
| 22 |
iface = gr.Interface(fn=chat_with_xiaoying, inputs="text", outputs="text")
|
| 23 |
iface.launch()
|