Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from threading import Thread
|
|
6 |
import torch
|
7 |
import spaces
|
8 |
import gradio as gr
|
9 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TextIteratorStreamer
|
10 |
|
11 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
12 |
|
@@ -72,7 +72,7 @@ quantization_config = BitsAndBytesConfig(
|
|
72 |
bnb_4bit_compute_dtype=torch.bfloat16
|
73 |
)
|
74 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
75 |
-
model =
|
76 |
MODEL_ID,
|
77 |
device_map="auto",
|
78 |
quantization_config=quantization_config,
|
@@ -85,12 +85,11 @@ gr.ChatInterface(
|
|
85 |
title=EMOJI + " " + MODEL_NAME,
|
86 |
description=DESCRIPTION,
|
87 |
examples=[
|
88 |
-
["
|
89 |
-
["
|
90 |
-
["
|
91 |
-
["
|
92 |
-
["
|
93 |
-
["Can you write a short story about a time-traveling detective?"]
|
94 |
],
|
95 |
additional_inputs_accordion=gr.Accordion(label="โ๏ธ Parameters", open=False),
|
96 |
additional_inputs=[
|
|
|
6 |
import torch
|
7 |
import spaces
|
8 |
import gradio as gr
|
9 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, TextIteratorStreamer, AutoModelForSeq2SeqLM
|
10 |
|
11 |
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
12 |
|
|
|
72 |
bnb_4bit_compute_dtype=torch.bfloat16
|
73 |
)
|
74 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
|
75 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(
|
76 |
MODEL_ID,
|
77 |
device_map="auto",
|
78 |
quantization_config=quantization_config,
|
|
|
85 |
title=EMOJI + " " + MODEL_NAME,
|
86 |
description=DESCRIPTION,
|
87 |
examples=[
|
88 |
+
["ูู ูู
ููู ุญู ุงูู
ุนุงุฏูุฉ 2x + 3 = 11 ููู
ุชุบูุฑ xุ"],
|
89 |
+
["ุงูุชุจ ูุตูุฏุฉ ู
ูุญู
ูุฉ ุนู ู
ุฏููุฉ ุงููุฏุณ ุงูุดุฑููุฉ."],
|
90 |
+
["ู
ู ูุงู ุฃูู ุดุฎุต ูู
ุดู ุนูู ุณุทุญ ุงููู
ุฑุ"],
|
91 |
+
["ุฃูุตู ุจุจุนุถ ูุชุจ ุงูุฎูุงู ุงูุนูู
ู ุงูุดููุฑุฉ."],
|
92 |
+
["ูู ูู
ููู ูุชุงุจุฉ ูุตุฉ ูุตูุฑุฉ ุนู ู
ุญูู ูุณุงูุฑ ุนุจุฑ ุงูุฒู
ูุ"]
|
|
|
93 |
],
|
94 |
additional_inputs_accordion=gr.Accordion(label="โ๏ธ Parameters", open=False),
|
95 |
additional_inputs=[
|