Update app.py
Browse files
app.py
CHANGED
|
@@ -2,10 +2,10 @@ import gradio as gr
|
|
| 2 |
import os
|
| 3 |
from openai import OpenAI
|
| 4 |
|
| 5 |
-
OPENAI_API_KEY = os.getenv(
|
| 6 |
openai_client = OpenAI(api_key=OPENAI_API_KEY)
|
| 7 |
|
| 8 |
-
def generate_response(prompt,
|
| 9 |
try:
|
| 10 |
response = openai_client.chat.completions.create(
|
| 11 |
model="gpt-3.5-turbo", # or another model of your choice
|
|
|
|
| 2 |
import os
|
| 3 |
from openai import OpenAI
|
| 4 |
|
| 5 |
+
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
|
| 6 |
openai_client = OpenAI(api_key=OPENAI_API_KEY)
|
| 7 |
|
| 8 |
+
def generate_response(prompt, temperature, top_p, max_tokens, repetition_penalty):
|
| 9 |
try:
|
| 10 |
response = openai_client.chat.completions.create(
|
| 11 |
model="gpt-3.5-turbo", # or another model of your choice
|