Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ def load_model(model_path):
|
|
11 |
base_model = AutoModelForCausalLM.from_pretrained(
|
12 |
config.base_model_name_or_path,
|
13 |
trust_remote_code=True,
|
14 |
-
|
15 |
)
|
16 |
|
17 |
base_model.config.use_cache = False
|
@@ -58,19 +58,21 @@ def generate_text(prompt):
|
|
58 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
59 |
model, tokenizer = load_model(os.path.join(os.getcwd(), "weights"))
|
60 |
|
61 |
-
|
62 |
iface = gr.Interface(
|
63 |
fn=generate_text,
|
64 |
inputs=[
|
65 |
-
gr.Textbox(label="Prompt",
|
66 |
-
|
|
|
|
|
|
|
67 |
outputs=gr.Textbox(label="Generated Text"),
|
68 |
title="LLaMA-3.2-3B-Instruct-QLoRA",
|
69 |
-
description="-3.2-3B-Instruct Finetuned using QLoRA on OpenAssistant/oasst1",
|
70 |
examples=[
|
71 |
["can you describe winter?"],
|
72 |
["How about we play a fun game?"],
|
73 |
-
]
|
74 |
)
|
75 |
|
76 |
|
|
|
11 |
base_model = AutoModelForCausalLM.from_pretrained(
|
12 |
config.base_model_name_or_path,
|
13 |
trust_remote_code=True,
|
14 |
+
token=os.environ["HF_TOKEN"],
|
15 |
)
|
16 |
|
17 |
base_model.config.use_cache = False
|
|
|
58 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
59 |
model, tokenizer = load_model(os.path.join(os.getcwd(), "weights"))
|
60 |
|
|
|
61 |
iface = gr.Interface(
|
62 |
fn=generate_text,
|
63 |
inputs=[
|
64 |
+
gr.Textbox(label="Prompt",
|
65 |
+
placeholder="Enter your prompt here...",
|
66 |
+
lines=5
|
67 |
+
),
|
68 |
+
],
|
69 |
outputs=gr.Textbox(label="Generated Text"),
|
70 |
title="LLaMA-3.2-3B-Instruct-QLoRA",
|
71 |
+
description="LLaMA-3.2-3B-Instruct Finetuned using QLoRA on OpenAssistant/oasst1",
|
72 |
examples=[
|
73 |
["can you describe winter?"],
|
74 |
["How about we play a fun game?"],
|
75 |
+
]
|
76 |
)
|
77 |
|
78 |
|