Hemanth-thunder commited on
Commit
8e3f470
1 Parent(s): 84b4174

added model path

Browse files
Files changed (2) hide show
  1. app.py +12 -4
  2. requirements.txt +1 -0
app.py CHANGED
@@ -1,7 +1,15 @@
1
  import gradio as gr
 
 
 
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
1
  import gradio as gr
2
+ from ctransformers import AutoModelForCausalLM
3
+ from huggingface_hub import hf_hub_download
4
+ model_name = "Hemanth-thunder/Tamil-Mistral-7B-Instruct-v0.1"
5
+ model_file = "tamil-mistral-7b-instruct-v0.1.Q4_K_M.gguf"
6
 
7
+ model_path = hf_hub_download(model_name, filename=model_file)
8
+ llm = AutoModelForCausalLM.from_pretrained(model_name, model_file=model_file,
9
+ model_type="mistral", gpu_layers=0)
10
+ def alternatingly_agree(message, history):
11
+ result = llm(message)
12
+ return result
13
+
14
 
15
+ gr.ChatInterface(alternatingly_agree).launch()
 
requirements.txt CHANGED
@@ -1,2 +1,3 @@
1
  gradio
 
2
  ctransformers
 
1
  gradio
2
+ jinja2
3
  ctransformers