File size: 394 Bytes
7be50ca
 
407c075
 
 
 
7be50ca
4a2adcb
7be50ca
4a2adcb
407c075
 
 
 
41d9b0f
7be50ca
407c075
 
 
 
4a2adcb
407c075
41d9b0f
1b5101a
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
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()