Vedarutvija commited on
Commit
af58445
1 Parent(s): 4cbbd39

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +43 -0
  2. requirements.txt +6 -0
app.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Let's get pipelines from transformers
2
+ import gradio as gr
3
+ import requests, uuid, json, time, openai
4
+
5
+
6
+ #credentials
7
+ openai.api_key = "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"
8
+ model = "gpt-3.5-turbo"
9
+
10
+
11
+
12
+
13
+
14
+ #code
15
+ def Mutilingual(prompt, ordshnv):
16
+
17
+ DEFAULT_SYSTEM_PROMPT = "You are Zebra GPT, an AI assistant developed by Veda. Your purpose is to provide intelligent and helpful assistance to users. Analyze user queries comprehensively and respond with accurate and concise answers. Focus on understanding the user's needs and offer solutions in a clear and informative manner. If additional information is required, ask polite and clarifying questions. Your goal is to assist users effectively, demonstrating the capabilities of Veda's advanced AI"
18
+ response = openai.ChatCompletion.create(
19
+ model= model,
20
+ messages=[
21
+ {f"role": "system", "content": DEFAULT_SYSTEM_PROMPT},
22
+ {f"role": "user", "content": prompt},
23
+ ], temperature=0,
24
+ )
25
+ return response.choices[0].message.content
26
+
27
+ css = """
28
+ #mkd {
29
+ height: 500px;
30
+ overflow: auto;
31
+ border: 1px solid #ccc;
32
+ }
33
+ """
34
+
35
+ with gr.Blocks(css=css) as demo:
36
+ gr.HTML("<h1><center>Open AI Multilinugual<h1><center>")
37
+ gr.HTML("<h3><center> <a href='https://katenterprise.com/'>Etown AI Assistance</a> model. 💬<h3><center>")
38
+ gr.ChatInterface(
39
+ Mutilingual,
40
+ examples=[["What is the quantum computers ?"], ["what is large language models"]]
41
+ )
42
+
43
+ demo.queue().launch(debug=True)
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ openai
2
+ fastapi
3
+ pydantic
4
+ uvicorn
5
+ requests
6
+ uuid