Spaces:
Build error
Build error
Download main.py from mehdi364/FreqtradeAi: direct link, hf CLI and curl.
- Browser
- Download file 647 Bytes
-
https://huggingface.co/spaces/mehdi364/FreqtradeAi/resolve/main/main.py
- Command line
-
hf download hf://spaces/mehdi364/FreqtradeAi/main.py
-
curl -L -o main.py https://huggingface.co/spaces/mehdi364/FreqtradeAi/resolve/main/main.py
647 Bytes
| import gradio as gr | |
| import freqtrade.strategy.interface as strategy | |
| from transformers import pipeline | |
| # مدل Transformer برای تحلیل بازار | |
| nlp = pipeline("sentiment-analysis") | |
| def analyze_text(text): | |
| result = nlp(text) | |
| return result[0]['label'], result[0]['score'] | |
| # ساخت رابط کاربری | |
| iface = gr.Interface( | |
| fn=analyze_text, | |
| inputs=gr.Textbox(label="Enter Market News"), | |
| outputs=[gr.Textbox(label="Sentiment"), gr.Textbox(label="Confidence")], | |
| title="Market Sentiment Analyzer", | |
| ) | |
| # اجرای برنامه | |
| if __name__ == "__main__": | |
| iface.launch(server_name="0.0.0.0", server_port=7860) | |