File size: 788 Bytes
c2493db
 
 
 
 
a4a1fc8
 
 
 
 
 
 
 
 
 
c2493db
0fe4e84
c2493db
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
import gradio as gr
from joblib import load
from huggingface_hub import hf_hub_download
import pandas as pd

# Baixe o modelo do Hugging Face Hub
model_path = hf_hub_download(
    repo_id="coan/botClaiton",
    filename="model.pkl",
    use_auth_token=True  # Caso o repositório seja privado
)

# Carregue o modelo
model = joblib.load(model_path)

# Carregar o modelo diretamente do Hugging Face
model_path = hf_hub_download(repo_id="coan/botClaiton", filename="model.joblib")
model = load(model_path)

# Função de previsão
def predict_price(open_price, high_price, low_price, volume):
    # Criar um dataframe com os dados de entrada
    data = pd.DataFrame({
        "Open": [open_price],
        "High": [high_price],
        "Low": [low_price],
        "Volume": [volume],
    })