ehristoforu commited on
Commit
f7333d2
0 Parent(s):

Duplicate from dolphinchat/2.0

Browse files
Files changed (4) hide show
  1. .gitattributes +35 -0
  2. README.md +23 -0
  3. dolphin.script.py +51 -0
  4. requirements.txt +1 -0
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: DolphinChat 2.0
3
+ emoji: 🐬
4
+ colorFrom: gray
5
+ colorTo: blue
6
+ sdk: gradio
7
+ sdk_version: 3.39.0
8
+ app_file: dolphin.script.py
9
+ pinned: false
10
+ duplicated_from: dolphinchat/2.0
11
+ ---
12
+
13
+ <p></p>
14
+ <h1>ℹ️ I am DolphinChat and I was created to help people!</h1>
15
+ <p></p>
16
+ <h1>✅️ I have been trained on almost the entire Internet!</h1>
17
+ <p></p>
18
+ <h1>♻️ I can communicate in more than 60 languages of the world!</h1>
19
+ <p></p>
20
+ <h1>📂 I work on open source and keep your data safe, I am a non-commercial project!</h1>
21
+ <p></p>
22
+ <h1>▶️ I'm almost the perfect chat assistant, so try me!</h1>
23
+ <p></p>
dolphin.script.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 DolphinChat assistant. You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."
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 = 1000,
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 2.0"
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()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ openai