shuvom commited on
Commit
57ff146
·
verified ·
1 Parent(s): be6a259

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -0
app.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import time
3
+ from ctransformers import AutoModelForCausalLM
4
+ def load_llm():
5
+ llm = AutoModelForCausalLM.from_pretrained("shuvom/yuj-v1-GGUF",
6
+ model_type='llama',
7
+ max_new_tokens = 1096,
8
+ repetition_penalty = 1.13,
9
+ temperature = 0.1
10
+ )
11
+ return llm
12
+ def llm_function(message, chat_history):
13
+ llm = load_llm()
14
+ formatted_message = f"<s>[INST]{message}[/INST]</s>"
15
+ response = llm(
16
+ formatted_message
17
+ )
18
+ output_texts = response
19
+ return output_texts
20
+ title = "Chat with the yuj-v1 model quantized version Demo"
21
+
22
+ desc = f'''
23
+ ## About the model:
24
+ The yuj-v1 model is a blend of advanced models strategically crafted to enhance Hindi Language Models (LLMs) effectively and democratically. Its primary goals include catalyzing the development of Hindi and its communities, making significant contributions to linguistic knowledge. The term "yuj," from Sanskrit, signifies fundamental unity, highlighting the integration of sophisticated technologies to improve the language experience for users in the Hindi-speaking community.
25
+ '''
26
+ examples = [
27
+ 'कंप्यूटर विज्ञान में तंत्रिका नेटवर्क क्या है?',
28
+ 'मुझे नवीनतम कृषि तकनीक के बारे में सरल तरीके से समझाएं ताकि एक बच्चा भी समझ सके'
29
+ ]
30
+
31
+ gr.ChatInterface(
32
+ fn=llm_function,
33
+ title=title,
34
+ description = desc,
35
+ examples=examples
36
+ ).launch()