File size: 915 Bytes
5801106
b52351a
 
ab9f15c
b52351a
ab9f15c
 
 
 
 
 
 
 
 
b52351a
 
ab9f15c
 
 
 
 
5801106
 
ab9f15c
5801106
ab9f15c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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()