Alesmikes commited on
Commit
9909c15
·
1 Parent(s): 2ac8865

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -20
app.py CHANGED
@@ -1,30 +1,33 @@
1
  import gradio as gr
2
  import openai
3
 
 
 
 
 
 
4
 
5
  def Question(OpenAI_Key, Ask_Question):
6
- # pass the generated text to audio
7
- openai.api_key = OpenAI_Key
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=(f"{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='Elvire. AI Forest Oracle',
26
  fn=Question,
27
  inputs=["text", "text"],
28
- outputs="text",)
 
29
 
30
- demo.launch()
 
1
  import gradio as gr
2
  import openai
3
 
4
+ css = """
5
+ body {
6
+ background-color: transparent;
7
+ }
8
+ """
9
 
10
  def Question(OpenAI_Key, Ask_Question):
11
+ # pass the generated text to audio
12
+ openai.api_key = OpenAI_Key
13
+ # Set up the model and prompt
14
+ model_engine = "text-davinci-003"
15
+ # Generate a response
16
+ completion = openai.Completion.create(
17
+ engine=model_engine,
18
+ prompt=(f"{Ask_Question}"),
19
+ max_tokens=1024,
20
+ n=1,
21
+ stop=None,
22
+ temperature=0.5,)
23
+ response = completion.choices[0].text
24
+ return response
25
+
 
 
 
26
  demo = gr.Interface(
27
  title='Elvire. AI Forest Oracle',
28
  fn=Question,
29
  inputs=["text", "text"],
30
+ outputs="text",
31
+ css=css)
32
 
33
+ demo.launch()