File size: 953 Bytes
9e3c545
3688143
 
8b2b705
9e3c545
8b2b705
 
 
3688143
8b2b705
 
 
3688143
c5421bc
8b2b705
9e3c545
8b2b705
 
 
 
 
d532c03
8b2b705
d532c03
9e3c545
8b2b705
 
 
 
 
3a80fb5
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
30
31
import gradio as gr
import os
import subprocess
from btc_trading_bot import predict_btc

def update_btc_dataset():
    subprocess.run(["python3", "fetch_btc_data.py"])
    return "βœ… BTC dataset updated successfully!"

def train_btc_model():
    subprocess.run(["python3", "train_btc_model.py"])
    return "βœ… BTC Model trained successfully!"

def trade():
    return predict_btc()

with gr.Blocks() as app:
    gr.Markdown("# πŸš€ **Bitcoin AI Trading Bot**")
    with gr.Row():
        update_btn = gr.Button("πŸ”„ Update BTC Dataset")
        train_btn = gr.Button("πŸ“ˆ Train BTC Model")
        predict_btn = gr.Button("πŸ” Predict BTC (Next 15 min)")
    
    output = gr.Textbox(label="Predicted BTC Prices")

    update_btn.click(update_btc_dataset, inputs=[], outputs=output)
    train_btn.click(train_btc_model, inputs=[], outputs=output)
    predict_btn.click(trade, inputs=[], outputs=output)

if __name__ == "__main__":
    app.launch()