Update app.py
Browse files
app.py
CHANGED
|
@@ -3,13 +3,13 @@ import openai
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
# OpenAI API ํค ์ค์
|
| 6 |
-
openai.api_key
|
| 7 |
|
| 8 |
# API ํธ์ถ ํจ์ ์ ์
|
| 9 |
def generate_response(user_prompt):
|
| 10 |
try:
|
| 11 |
# ChatCompletion ์๋ํฌ์ธํธ ์ฌ์ฉ
|
| 12 |
-
response =
|
| 13 |
model="ft:gpt-4o-2024-08-06:personal::AdfXb935", # fine-tuned ๋ชจ๋ธ ID
|
| 14 |
messages=[
|
| 15 |
{"role": "system", "content": (
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
# OpenAI API ํค ์ค์
|
| 6 |
+
client = openai.Client(api_key=os.getenv("OPENAI_API_KEY"))
|
| 7 |
|
| 8 |
# API ํธ์ถ ํจ์ ์ ์
|
| 9 |
def generate_response(user_prompt):
|
| 10 |
try:
|
| 11 |
# ChatCompletion ์๋ํฌ์ธํธ ์ฌ์ฉ
|
| 12 |
+
response = client.chat.completions.create(
|
| 13 |
model="ft:gpt-4o-2024-08-06:personal::AdfXb935", # fine-tuned ๋ชจ๋ธ ID
|
| 14 |
messages=[
|
| 15 |
{"role": "system", "content": (
|