Spaces:
Sleeping
Sleeping
artbreguez
commited on
Commit
β’
b25e1e6
1
Parent(s):
eccb31a
Update app.py
Browse files
app.py
CHANGED
@@ -14,15 +14,11 @@ import requests
|
|
14 |
import time
|
15 |
|
16 |
def download_model():
|
17 |
-
# URL do arquivo do modelo
|
18 |
model_url = "https://huggingface.co/artbreguez/BinaryOptionsXGB/resolve/main/eurusd.pkl?download=true"
|
19 |
|
20 |
-
# Baixar o arquivo do modelo
|
21 |
response = requests.get(model_url, stream=True)
|
22 |
|
23 |
-
# Verificar se o download foi bem-sucedido
|
24 |
if response.status_code == 200:
|
25 |
-
# Salvar o arquivo
|
26 |
with open('eurusd.pkl', 'wb') as f:
|
27 |
for chunk in response.iter_content(1024):
|
28 |
f.write(chunk)
|
@@ -32,7 +28,6 @@ def download_model():
|
|
32 |
print("Erro ao baixar o modelo:", response.status_code)
|
33 |
return False
|
34 |
|
35 |
-
# Realizar o download do modelo
|
36 |
download_success = download_model()
|
37 |
|
38 |
if download_success:
|
@@ -44,9 +39,6 @@ else:
|
|
44 |
print("Download do modelo falhou.")
|
45 |
|
46 |
|
47 |
-
# model = load_model()
|
48 |
-
|
49 |
-
|
50 |
def generate_candle_image(df, predicao):
|
51 |
df['DateTime'] = pd.to_datetime(df['DateTime'])
|
52 |
df.set_index('DateTime', inplace=True)
|
@@ -186,6 +178,11 @@ def generate_predictions():
|
|
186 |
|
187 |
outputs = gr.Image(type='pil', label='label')
|
188 |
inputs = None
|
189 |
-
title = "Binary Options Predictor"
|
190 |
-
description = "
|
191 |
-
|
|
|
|
|
|
|
|
|
|
|
|
14 |
import time
|
15 |
|
16 |
def download_model():
|
|
|
17 |
model_url = "https://huggingface.co/artbreguez/BinaryOptionsXGB/resolve/main/eurusd.pkl?download=true"
|
18 |
|
|
|
19 |
response = requests.get(model_url, stream=True)
|
20 |
|
|
|
21 |
if response.status_code == 200:
|
|
|
22 |
with open('eurusd.pkl', 'wb') as f:
|
23 |
for chunk in response.iter_content(1024):
|
24 |
f.write(chunk)
|
|
|
28 |
print("Erro ao baixar o modelo:", response.status_code)
|
29 |
return False
|
30 |
|
|
|
31 |
download_success = download_model()
|
32 |
|
33 |
if download_success:
|
|
|
39 |
print("Download do modelo falhou.")
|
40 |
|
41 |
|
|
|
|
|
|
|
42 |
def generate_candle_image(df, predicao):
|
43 |
df['DateTime'] = pd.to_datetime(df['DateTime'])
|
44 |
df.set_index('DateTime', inplace=True)
|
|
|
178 |
|
179 |
outputs = gr.Image(type='pil', label='label')
|
180 |
inputs = None
|
181 |
+
title = "π Binary Options Predictor π"
|
182 |
+
description = """
|
183 |
+
<div>
|
184 |
+
<a style="display:inline-block" href='https://github.com/suno-ai/bark'><img src='https://img.shields.io/github/stars/suno-ai/bark?style=social' /></a>
|
185 |
+
This tool generates a simulated candlestick chart for EUR/USD. If the last candlestick is green, it indicates an upward trend, while a red candlestick suggests a downward trend.
|
186 |
+
</div>
|
187 |
+
"""
|
188 |
+
gr.Interface(generate_predictions, inputs, outputs, title=title, description=description).launch(debug=False)
|