Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from joblib import load
|
3 |
+
from huggingface_hub import hf_hub_download
|
4 |
+
import pandas as pd
|
5 |
+
|
6 |
+
# Carregar o modelo diretamente do Hugging Face
|
7 |
+
model_path = hf_hub_download(repo_id="coan/botClaiton", filename="model.pkl")
|
8 |
+
model = load(model_path)
|
9 |
+
|
10 |
+
# Função de previsão
|
11 |
+
def predict_price(open_price, high_price, low_price, volume):
|
12 |
+
# Criar um dataframe com os dados de entrada
|
13 |
+
data = pd.DataFrame({
|
14 |
+
"Open": [open_price],
|
15 |
+
"High": [high_price],
|
16 |
+
"Low": [low_price],
|
17 |
+
"Volume": [volume],
|
18 |
+
})
|