crypto_crewAI / chat_gradio.py
quocdat25's picture
Upload folder using huggingface_hub
b252213 verified
# 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.001)
yield response[: i+1]
# return response
gr.ChatInterface(
predict,
description="Which cryptocurrency are you looking to delve into? E.g: Doge, ETH, BTC... "
).launch()