Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,15 @@ import gradio as gr
|
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
-
#
|
|
|
6 |
model_name = "joelelangovan/tamil-llama-genesis-finetuned"
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
8 |
model = AutoModelForCausalLM.from_pretrained(
|
9 |
model_name,
|
10 |
device_map="auto",
|
@@ -51,7 +57,10 @@ demo = gr.Interface(
|
|
51 |
],
|
52 |
outputs=gr.Textbox(label="பதில்"),
|
53 |
title="Tamil LLaMA - ஆதியாகமம் விளக்க உதவி",
|
54 |
-
description="
|
|
|
|
|
|
|
55 |
examples=example_prompts,
|
56 |
allow_flagging="never",
|
57 |
)
|
|
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
|
5 |
+
# Use base model's tokenizer
|
6 |
+
base_model_name = "abhinand/tamil-llama-7b-instruct-v0.1"
|
7 |
model_name = "joelelangovan/tamil-llama-genesis-finetuned"
|
8 |
+
|
9 |
+
# Load tokenizer from base model
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
|
11 |
+
tokenizer.pad_token = tokenizer.eos_token
|
12 |
+
|
13 |
+
# Load fine-tuned model
|
14 |
model = AutoModelForCausalLM.from_pretrained(
|
15 |
model_name,
|
16 |
device_map="auto",
|
|
|
57 |
],
|
58 |
outputs=gr.Textbox(label="பதில்"),
|
59 |
title="Tamil LLaMA - ஆதியாகமம் விளக்க உதவி",
|
60 |
+
description="""
|
61 |
+
ஆதியாகமம் முதல் அதிகாரம் பற்றிய கேள்விகளுக்கு விளக்கம் அளிக்கும் AI மாதிரி.
|
62 |
+
Base Model: abhinand/tamil-llama-7b-instruct-v0.1
|
63 |
+
""",
|
64 |
examples=example_prompts,
|
65 |
allow_flagging="never",
|
66 |
)
|