Rubens commited on
Commit
3b1ef6f
1 Parent(s): d08688f

commit 800

Browse files
Files changed (4) hide show
  1. .gitattributes +0 -0
  2. README.md +0 -0
  3. app.py +18 -16
  4. requirements.txt +0 -0
.gitattributes CHANGED
File without changes
README.md CHANGED
File without changes
app.py CHANGED
@@ -1,23 +1,25 @@
1
  import openai
2
  import gradio as gr
3
 
4
- def metadata_generator(api,text):
5
- openai.api_key=api
 
6
  response = openai.Completion.create(
7
- engine="text-davinci-003",
8
- prompt="{}\n\nPlease provide 6 semantically similar phrases for the phrase above mentioned".format(text),
9
- temperature=0.9,
10
- max_tokens=200,
11
- top_p=1.0,
12
- frequency_penalty=0.0,
13
- presence_penalty=0.0
 
14
  )
15
- resumo=response["choices"][0].text
16
  return resumo
17
 
18
- demo = gr.Interface(fn=metadata_generator, inputs=\
19
- [gr.inputs.Textbox(label='ENTER OPEN AI API KEY'), \
20
- gr.inputs.Textbox(label='ENTER A PHRASE FOR SEMANTIC SIMILARITY - Click *Clear* before adding new input')], \
21
- outputs=gr.outputs.Textbox(label='SEMANTIC SIMILAR PHRASES'),\
22
- css='div {margin-left: auto; margin-right: auto; width: 100%;\
23
- background-image: url("https://drive.google.com/uc?export=view&id=1KNnISAUcvh2Pt08f-EJZJYCIgkrKw3PI"); repeat 0 0;}').launch(share=False)
 
1
  import openai
2
  import gradio as gr
3
 
4
+
5
+ def metadata_generator(api, text):
6
+ openai.api_key = api
7
  response = openai.Completion.create(
8
+ engine="text-davinci-003",
9
+ prompt="{}\n\nPlease provide 6 semantically similar phrases for the phrase above mentioned".format(
10
+ text),
11
+ temperature=0.9,
12
+ max_tokens=800,
13
+ top_p=1.0,
14
+ frequency_penalty=0.0,
15
+ presence_penalty=0.0
16
  )
17
+ resumo = response["choices"][0].text
18
  return resumo
19
 
20
+ demo = gr.Interface(fn=metadata_generator, inputs=[gr.inputs.Textbox(label='ENTER OPEN AI API KEY'),
21
+ gr.inputs.Textbox(label='ENTER A PHRASE FOR SEMANTIC SIMILARITY - Click *Clear* before adding new input')],
22
+ outputs=gr.outputs.Textbox(
23
+ label='SEMANTIC SIMILAR PHRASES'),
24
+ css='div {margin-left: auto; margin-right: auto; width: 100%;\
25
+ background-image: url("https://drive.google.com/uc?export=view&id=1KNnISAUcvh2Pt08f-EJZJYCIgkrKw3PI"); repeat 0 0;}').launch(share=False)
requirements.txt CHANGED
File without changes