Fiacre's picture
Update app.py
3e00ee2
raw
history blame
No virus
1.42 kB
import os
os.system("pip install openai")
import openai
import gradio as gr
model="gpt-3.5-turbo"
task =f""" Your task is to help a university lecturer create a project scope table for """
formatting = f"""Define what is the project objective, in scope, out of scope and assumptions. Do this in a tabular format. The table comprises six rows. The first row is a single column labeled "Project Objective". The second row is a single column stating the project objectives. The thid row contains two columns labeled "In Scope" and "Out of Scope". The fourth row contains two columns describing what is in scope and out of scope. The fifth row is a single column named "Assumptions". The sixth row is a single column describing the assumptions. Below each of these name, populate with detail content relevant to each title."""
default_input = "I am looking to elevate our assessments and enable lecturers to develop more authentic assessments."
def get_completion(describe_your_project_idea_here):
messages = [{"role": "user", "content": task + describe_your_project_idea_here + formatting}]
response = openai.ChatCompletion.create(
model=model,
messages=messages,
temperature=0, # this is the degree of randomness of the model's output
)
return response.choices[0].message["content"]
iface = gr.Interface(fn=get_completion, inputs="text", outputs="markdown")
iface.launch()