tommy24 commited on
Commit
1e2a8ca
Β·
1 Parent(s): 575a114

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  import openai as ai
3
  import random
 
4
  import os
5
  import requests
6
 
@@ -41,8 +42,12 @@ def greet(prompt):
41
  if response != 500:
42
  response = response['choices'][0]['text']
43
  response = response.strip()
 
 
 
 
44
  # response = "\n",response,"\n"
45
- return response
46
  else:
47
  return "Model is Down. Our team is working on it πŸ˜ƒ"
48
 
 
1
  import gradio as gr
2
  import openai as ai
3
  import random
4
+ import base64
5
  import os
6
  import requests
7
 
 
42
  if response != 500:
43
  response = response['choices'][0]['text']
44
  response = response.strip()
45
+ result = base64.b64encode(response.encode())
46
+ result_strip = str(result)
47
+ result_strip2 = result_strip.replace("b", "")
48
+ result_strip3 = result_strip2.replace("'", "")
49
  # response = "\n",response,"\n"
50
+ return result_strip3
51
  else:
52
  return "Model is Down. Our team is working on it πŸ˜ƒ"
53