pip install websocket-clientmodel_url = "ws://localhost:5005"from langchain.prompts import PromptTemplatefrom langchain.chains import LLMChainfrom langchain.llms import TextGenfrom langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandlerfrom langchain.globals import set_debugset_debug(True)template = """Question: {question}Answer: Let's think step by step."""prompt = PromptTemplate(template=template, input_variables=["question"])llm = TextGen(model_url=model_url, streaming=True, callbacks=[StreamingStdOutCallbackHandler()])llm_chain = LLMChain(prompt=prompt, llm=llm)question = "What NFL team won the Super Bowl in the year Justin Bieber was born?"llm_chain.run(question)llm = TextGen(    model_url = model_url,    streaming=True)for chunk in llm.stream("Ask 'Hi, how are you?' like a pirate:'",        stop=["'","\n"]):    print(chunk, end='', flush=True)PreviousNebula (Symbl.ai)NextTitan TakeoffSet model_url and run the exampleStreaming VersionCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
GitHub:oobabooga/text-generation-webui A gradio web UI for running Large Language Models like LLaMA, llama.cpp, GPT-J, Pythia, OPT, and GALACTICA.
GitHub:oobabooga/text-generation-webui A gradio web UI for running Large Language Models like LLaMA, llama.cpp, GPT-J, Pythia, OPT, and GALACTICA. ->: pip install websocket-clientmodel_url = "ws://localhost:5005"from langchain.prompts import PromptTemplatefrom langchain.chains import LLMChainfrom langchain.llms import TextGenfrom langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandlerfrom langchain.globals import set_debugset_debug(True)template = """Question: {question}Answer: Let's think step by step."""prompt = PromptTemplate(template=template, input_variables=["question"])llm = TextGen(model_url=model_url, streaming=True, callbacks=[StreamingStdOutCallbackHandler()])llm_chain = LLMChain(prompt=prompt, llm=llm)question = "What NFL team won the Super Bowl in the year Justin Bieber was born?"llm_chain.run(question)llm = TextGen(    model_url = model_url,    streaming=True)for chunk in llm.stream("Ask 'Hi, how are you?' like a pirate:'",        stop=["'","\n"]):    print(chunk, end='', flush=True)PreviousNebula (Symbl.ai)NextTitan TakeoffSet model_url and run the exampleStreaming VersionCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.