Spaces:
Sleeping
Sleeping
update gpt4
Browse files
app.py
CHANGED
@@ -213,6 +213,28 @@ file_transcribe = gr.Interface(
|
|
213 |
)
|
214 |
import google.generativeai as genai
|
215 |
def gpt4write(apikeystr,transcribe_text):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
return 'ok'
|
217 |
def gewritenote(inputscript):
|
218 |
api_key = genaikey
|
|
|
213 |
)
|
214 |
import google.generativeai as genai
|
215 |
def gpt4write(apikeystr,transcribe_text):
|
216 |
+
# openaiobj = OpenAI(
|
217 |
+
# # This is the default and can be omitted
|
218 |
+
|
219 |
+
# api_key=openaikeystr,
|
220 |
+
# )
|
221 |
+
if hugapikey=='test':
|
222 |
+
realkey=openaikeystr
|
223 |
+
else:
|
224 |
+
realkey=hugapikey
|
225 |
+
|
226 |
+
#openaiojb =OpenAI(base_url="http://localhost:1234/v1", api_key="not-needed")
|
227 |
+
openaiobj =OpenAI( api_key=realkey)
|
228 |
+
text = inputtext
|
229 |
+
#openaikey.set_key(openaikeystr)
|
230 |
+
#print('process_chunk',openaikey.get_key())
|
231 |
+
#chunks = split_into_chunks(text)
|
232 |
+
#response='éęÆåꮵęč°ē“éēµę\n\n'
|
233 |
+
|
234 |
+
finalresponse=call_openai_api(openaiobj,transcribe_text)
|
235 |
+
# response=response+call_openai_summary(openaiobj,chunk)
|
236 |
+
return finalresponse
|
237 |
+
|
238 |
return 'ok'
|
239 |
def gewritenote(inputscript):
|
240 |
api_key = genaikey
|