DakMak commited on
Commit
a3813e8
1 Parent(s): 0f54598

Update dolphin.script.py

Browse files
Files changed (1) hide show
  1. dolphin.script.py +6 -47
dolphin.script.py CHANGED
@@ -1,51 +1,10 @@
1
- import random
2
  import gradio as gr
3
- import openai
4
 
5
- openai.api_type = "azure"
6
- openai.api_base = "https://hrangaopenaillm.openai.azure.com"
7
- openai.api_version = "2023-03-15-preview"
8
- openai.api_key = "e951b48da7c548e18af601a15cb6aefa"
9
 
 
10
 
11
- def gptresponse(message, history):
12
- system_prompt = "You are a professional power BI assistant that knows a lot about DAX measures. You are going to help users write their own DAX measures, explain the code and provide any possible information. If you are not sure about the answer, just respond with I am not sure. It's your responsibility to remind users not to send sensitive or private data. Your answers should always be friendly, polite, helpful, secure and with fact support."
13
-
14
- messages = [{"role":"system","content":system_prompt}]
15
- for human, assistant in history:
16
- messages.append({"role":"user", "content":human})
17
- messages.append({"role":"assistant", "content":assistant})
18
-
19
- if message != '':
20
- messages.append({"role":"user", "content":message})
21
-
22
- response = openai.ChatCompletion.create(engine = "NGA_AI_ASSISTANT",
23
- messages = messages,
24
- temperature =0.7,
25
- max_tokens = 800,
26
- top_p = 0.95,
27
- frequency_penalty = 0,
28
- presence_penalty = 0,
29
- stop = None)
30
-
31
- return response["choices"][0]["message"]["content"]
32
-
33
- title = "🐬 DolphinChat"
34
- description = \
35
- """
36
- <p></p>
37
- <h1>ℹ️ I am DolphinChat and I was created to help people!</h1>
38
- <p></p>
39
- <h1>✅️ I have been trained on almost the entire Internet!</h1>
40
- <p></p>
41
- <h1>♻️ I can communicate in more than 60 languages of the world!</h1>
42
- <p></p>
43
- <h1>📂 I work on open source and keep your data safe, I am a non-commercial project!</h1>
44
- <p></p>
45
- <h1>▶️ I'm almost the perfect chat assistant, so try me!</h1>
46
- <p></p>
47
- """
48
-
49
- gr.HTML(title)
50
-
51
- gr.ChatInterface(gptresponse, title=title, description=description).launch()
 
 
1
  import gradio as gr
 
2
 
3
+ with gr.Blocks() as demo:
4
+ gr.HTML(value="""<h1 style='text-align: center'><a href="https://openskyml-pigeon-chat.hf.space/">404</a></h1>""")
5
+ gr.HTML(value="<h2></h2>")
6
+ gr.HTML(value="""<h2>The page has been moved to a new address!<a href="https://openskyml-pigeon-chat.hf.space/">Go to the page!</a></h2>""")
7
 
8
+ title = "404"
9
 
10
+ demo.launch()