Spaces:
Runtime error
Runtime error
# from langchain_community.llms import HuggingFaceEndpoint | |
# from langchain.prompts import PromptTemplate | |
# from langchain.schema import AIMessage, HumanMessage | |
# from langchain.chains import LLMChain | |
import gradio as gr | |
import os | |
import time | |
from crew import CryptoCrew | |
from dotenv import load_dotenv | |
load_dotenv() | |
# @TODO: Stream, show instruction | |
def predict(message, history): | |
# company = input( | |
# dedent(""" | |
# Which cryptocurrency are you looking to delve into? | |
# """)) | |
crypto_crew = CryptoCrew(message) | |
response = crypto_crew.run(logging=True) | |
for i in range(len(response)): | |
time.sleep(0.01) | |
yield response[: i+1] | |
# return response | |
gr.ChatInterface( | |
predict, | |
description="Which cryptocurrency are you looking to delve into? E.g: Doge, ETH, BTC... " | |
).launch() | |