joelelangovan commited on
Commit
5e6b78a
·
verified ·
1 Parent(s): 518aa89

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -2,9 +2,15 @@ import gradio as gr
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import torch
4
 
5
- # Load model and tokenizer
 
6
  model_name = "joelelangovan/tamil-llama-genesis-finetuned"
7
- tokenizer = AutoTokenizer.from_pretrained(model_name)
 
 
 
 
 
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="ஆதியாகமம் முதல் அதிகாரம் பற்றிய கேள்விகளுக்கு விளக்கம் அளிக்கும் AI மாதிரி",
 
 
 
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
  )