artbreguez commited on
Commit
b25e1e6
β€’
1 Parent(s): eccb31a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
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 = "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."
191
- gr.Interface(generate_predictions, inputs, outputs, title=title, description=description).launch(debug=True)
 
 
 
 
 
 
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)