hyuan5040 EngrZiaQazi commited on
Commit
49eb71e
0 Parent(s):

Duplicate from EngrZiaQazi/Chat_GPT_Zia_Apps

Browse files

Co-authored-by: Qazi Zia Ullah <EngrZiaQazi@users.noreply.huggingface.co>

Files changed (5) hide show
  1. .gitattributes +34 -0
  2. ChatGPT_app.py +26 -0
  3. README.md +13 -0
  4. app.py +29 -0
  5. requirements.txt +1 -0
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
ChatGPT_app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import openai
2
+ import gradio as gr
3
+ import time
4
+ def Question(Ask_Question):
5
+ # pass the generated text to audio
6
+ openai.api_key = "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"
7
+ # Set up the model and prompt
8
+ model_engine = "text-davinci-003"
9
+ #prompt = "who is alon musk?"
10
+ # Generate a response
11
+ completion = openai.Completion.create(
12
+ engine=model_engine,
13
+ prompt=Ask_Question,
14
+ max_tokens=1024,
15
+ n=1,
16
+ stop=None,
17
+ temperature=0.5,)
18
+ response = completion.choices[0].text
19
+ #out_result=resp['message']
20
+ return response
21
+ demo = gr.Interface(
22
+ title='OpenAI ChatGPT Application',
23
+ fn=Question,
24
+ inputs="text", outputs="text")
25
+
26
+ demo.launch()
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Chat GPT Zia Apps
3
+ emoji: 😻
4
+ colorFrom: pink
5
+ colorTo: pink
6
+ sdk: gradio
7
+ sdk_version: 3.15.0
8
+ app_file: app.py
9
+ pinned: false
10
+ duplicated_from: EngrZiaQazi/Chat_GPT_Zia_Apps
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import openai
3
+
4
+
5
+ def Question(Ask_Question):
6
+ # pass the generated text to audio
7
+ openai.api_key = "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"
8
+ # Set up the model and prompt
9
+ model_engine = "text-davinci-003"
10
+ #prompt = "who is alon musk?"
11
+ # Generate a response
12
+ completion = openai.Completion.create(
13
+ engine=model_engine,
14
+ prompt=Ask_Question,
15
+ max_tokens=1024,
16
+ n=1,
17
+ stop=None,
18
+ temperature=0.5,)
19
+ response = completion.choices[0].text
20
+ #out_result=resp['message']
21
+ return response
22
+
23
+
24
+ demo = gr.Interface(
25
+ title='OpenAI ChatGPT Application',
26
+ fn=Question,
27
+ inputs="text", outputs="text")
28
+
29
+ demo.launch()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ openai