Commit
•
8e3f470
1
Parent(s):
84b4174
added model path
Browse files- app.py +12 -4
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,7 +1,15 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
|
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
|