update init
Browse files
app.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModelForSeq2SeqLM
|
| 3 |
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
# load the tokenizer and the model
|
| 10 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 11 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 12 |
|
| 13 |
-
|
| 14 |
-
model.save_pretrained("./qwen3")
|
| 15 |
|
| 16 |
# prepare the model input
|
| 17 |
prompt = "Give me a short introduction to large language model."
|
|
@@ -46,5 +46,6 @@ def greet(input):
|
|
| 46 |
|
| 47 |
return "thinking content:" + thinking_content + "\n" + "content:" + content
|
| 48 |
|
|
|
|
| 49 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 50 |
demo.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModelForSeq2SeqLM
|
| 3 |
|
| 4 |
+
model_name = "Qwen/Qwen3-8B"
|
| 5 |
|
| 6 |
+
# load the tokenizer and the model
|
| 7 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 9 |
|
| 10 |
+
# tokenizer.save_pretrained("./qwen3")
|
| 11 |
+
# model.save_pretrained("./qwen3")
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
+
def greet(input):
|
|
|
|
| 15 |
|
| 16 |
# prepare the model input
|
| 17 |
prompt = "Give me a short introduction to large language model."
|
|
|
|
| 46 |
|
| 47 |
return "thinking content:" + thinking_content + "\n" + "content:" + content
|
| 48 |
|
| 49 |
+
|
| 50 |
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 51 |
demo.launch()
|