Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -314,7 +314,8 @@ def train_full(limit,tsym,crypto_name,timeframe):
|
|
| 314 |
SECRET_CODE = "ilovemypythonprogram"
|
| 315 |
BASE_API_URL = "https://my-model-api.shares.zrok.io/api/training/"
|
| 316 |
|
| 317 |
-
def run_prediction_for_gradio(
|
|
|
|
| 318 |
# Calculate validation_date
|
| 319 |
now = datetime.now(timezone.utc)
|
| 320 |
|
|
@@ -349,7 +350,7 @@ def run_prediction_for_gradio(limit, tsym, crypto_name, timeframe):
|
|
| 349 |
# 1. Send PENDING status
|
| 350 |
predictionID = result.get("id")
|
| 351 |
# Call the train_full function to get predictions
|
| 352 |
-
predicted_values = train_full(
|
| 353 |
|
| 354 |
# Initialize output_str before potential use in except block
|
| 355 |
output_str = ""
|
|
@@ -384,7 +385,7 @@ def run_prediction_for_gradio(limit, tsym, crypto_name, timeframe):
|
|
| 384 |
iface = gr.Interface(
|
| 385 |
fn=run_prediction_for_gradio,
|
| 386 |
inputs=[
|
| 387 |
-
|
| 388 |
gr.Dropdown(choices=["USD", "EUR", "GBP"], value="USD", label="Target Symbol (tsym)"),
|
| 389 |
gr.Dropdown(choices=["BTC", "ETH", "SOL"], value="ETH", label="Crypto Name"),
|
| 390 |
gr.Dropdown(choices=["1d", "3d", "1h", "4h", "6h", "12h"], value="1d", label="Timeframe")
|
|
|
|
| 314 |
SECRET_CODE = "ilovemypythonprogram"
|
| 315 |
BASE_API_URL = "https://my-model-api.shares.zrok.io/api/training/"
|
| 316 |
|
| 317 |
+
def run_prediction_for_gradio(tsym, crypto_name, timeframe):
|
| 318 |
+
limit = 800
|
| 319 |
# Calculate validation_date
|
| 320 |
now = datetime.now(timezone.utc)
|
| 321 |
|
|
|
|
| 350 |
# 1. Send PENDING status
|
| 351 |
predictionID = result.get("id")
|
| 352 |
# Call the train_full function to get predictions
|
| 353 |
+
predicted_values = train_full(tsym, crypto_name, timeframe)
|
| 354 |
|
| 355 |
# Initialize output_str before potential use in except block
|
| 356 |
output_str = ""
|
|
|
|
| 385 |
iface = gr.Interface(
|
| 386 |
fn=run_prediction_for_gradio,
|
| 387 |
inputs=[
|
| 388 |
+
|
| 389 |
gr.Dropdown(choices=["USD", "EUR", "GBP"], value="USD", label="Target Symbol (tsym)"),
|
| 390 |
gr.Dropdown(choices=["BTC", "ETH", "SOL"], value="ETH", label="Crypto Name"),
|
| 391 |
gr.Dropdown(choices=["1d", "3d", "1h", "4h", "6h", "12h"], value="1d", label="Timeframe")
|