File size: 1,111 Bytes
024cdba
8f7eb5d
024cdba
16e3d29
 
 
024cdba
 
 
 
 
16e3d29
 
 
3d5de59
896f744
3d5de59
896f744
3d5de59
5b1ce4f
8c35515
 
16e3d29
8c35515
 
 
 
 
 
896f744
8c35515
896f744
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import gradio as gr
#from transformers import pipeline


# previous code #1
"""
def greet(name):
    return "Hello " + name + "!!"

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()
"""

# active code

"""
# reference: https://medium.com/@rowel/gradio-hugging-face-for-rapid-deep-learning-app-development-709a78e7ccc0
# https://huggingface.co/spaces/rowel/22k-image-classification

pipe = pipeline(task="conversational",
                # model for 22k-category classification
                model="abhinand/malayalam-llama-7b-instruct-v0.1")

gr.Interface.from_pipeline(pipe,
                           title="Chat",              
                           description="Ask your questions in malayalam",
                           examples = ['കേരളത്തിലെ ജില്ലകൾ ഏതെല്ലാം ?',
                                       'കേരളത്തിന്റെ തലസ്ഥാനം എവിടെയാണ് ?',],
                           ).launch(inbrowser=True)
"""

gr.load("abhinand/malayalam-llama-7b-instruct-v0.1").launch()