ask-fsdl / app.py
charlesfrye's picture
rough and ready ask-fsdl backend
407c075
raw
history blame contribute delete
394 Bytes
import logging
import os
import sys
if "." not in sys.path:
sys.path.append(".")
import gradio as gr
import openai
import ask_fsdl
openai.api_key = os.getenv("OPENAI_API_KEY")
runner = ask_fsdl.get_runner()
def go(query):
model_response = runner(query)
logging.info(model_response)
return model_response
iface = gr.Interface(fn=go, inputs="text", outputs="text")
iface.launch()