File size: 385 Bytes
5bd6c7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
from langchain.llms import OpenAI

def chatOpenAI(text):
    llm = OpenAI(temperature=0.9)
    return llm(text)

with gr.Blocks() as demo:
    gr.Markdown(
        '''
        # LangChain Test
        LLM先跑起来,GO GO。
        LangChain接入openAI,简单测试。
        ''')
    gr.Interface(fn=chatOpenAI, inputs="text", outputs="text")
demo.launch()