Spaces:
Sleeping
Sleeping
import gradio as gr | |
from openai import OpenAI | |
client = OpenAI(api_key="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") | |
def get_completion(prompt, model="ft:gpt-3.5-turbo-0613:personal::8fjNPFEp"): | |
messages = [{"role": "system", "content": "you are an english teaching chatbot who replies everything in both english and korean. but each line should be in english and korean."}, {"role": "user", "content": prompt}] | |
response = client.chat.completions.create( | |
model=model, | |
messages=messages, | |
temperature=0 | |
) | |
return response | |
title = "Enter your Prompt" | |
description = """ | |
This is fine tuned model. Which helps in learning english | |
<img src = "https://upload.wikimedia.org/wikipedia/commons/4/4d/OpenAI_Logo.svg" width=300px> | |
""" | |
demo = gr.ChatInterface(fn=get_completion, title=title, description=description ).queue() | |
if __name__ == "__main__": | |
demo.launch() |