dindizz commited on
Commit
eb4e67e
·
verified ·
1 Parent(s): d28e04b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -26,7 +26,7 @@ def create_flashcards(content):
26
  # Fetch the secret prompt from environment variables
27
  prompt = os.getenv("FLASHCARD_PROMPT")
28
 
29
- response = openai.ChatCompletion.create(
30
  model="gpt-3.5-turbo",
31
  messages=[
32
  {"role": "system", "content": prompt},
@@ -36,7 +36,7 @@ def create_flashcards(content):
36
  temperature=0.7
37
  )
38
 
39
- flashcards = response["choices"][0]["message"]["content"].strip()
40
  return flashcards
41
 
42
  # Function to process a single URL and generate flashcards
@@ -69,4 +69,4 @@ iface = gr.Interface(
69
 
70
  # Launch the interface
71
  if __name__ == "__main__":
72
- iface.launch(share=False)
 
26
  # Fetch the secret prompt from environment variables
27
  prompt = os.getenv("FLASHCARD_PROMPT")
28
 
29
+ response = openai.chat.completions.create(
30
  model="gpt-3.5-turbo",
31
  messages=[
32
  {"role": "system", "content": prompt},
 
36
  temperature=0.7
37
  )
38
 
39
+ flashcards = response.choices[0].message.content.strip()
40
  return flashcards
41
 
42
  # Function to process a single URL and generate flashcards
 
69
 
70
  # Launch the interface
71
  if __name__ == "__main__":
72
+ iface.launch(share=False, ssr=False)