Download index.html from AdamBot27/AdamAi: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/spaces/AdamBot27/AdamAi/resolve/main/index.html
- Command line
-
hf download hf://spaces/AdamBot27/AdamAi/index.html
-
curl -L -o index.html https://huggingface.co/spaces/AdamBot27/AdamAi/resolve/main/index.html
1.91 kB
| <html> | |
| <head> | |
| <title>AdamAi Beta 1</title> | |
| <!-- Chargement de l'environnement Gradio-lite pour navigateur --> | |
| <script type="module" src="https://jsdelivr.net"></script> | |
| <link rel="stylesheet" href="https://jsdelivr.net" /> | |
| <style> | |
| body { margin: 0; background-color: #f9fafb; font-family: sans-serif; } | |
| </style> | |
| </head> | |
| <body> | |
| <!-- Composant Gradio App --> | |
| <gradio-app> | |
| <main-python> | |
| import gradio as gr | |
| import urllib.request | |
| import json | |
| def ask_adam_ai(question): | |
| # ADRESSE API CORRECTE ET FIXE : | |
| url = "https://together.xyz" | |
| headers = { | |
| "Authorization": "Bearer 815c3ec04bb4db4d3fa7ffc64966d58d9ad7662c59efd5dfdf935ec213c9e97c", | |
| "Content-Type": "application/json" | |
| } | |
| data = { | |
| "model": "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B", | |
| "messages": [{"role": "user", "content": question}], | |
| "temperature": 0.6 | |
| } | |
| req = urllib.request.Request(url, data=json.dumps(data).encode('utf-8'), headers=headers) | |
| try: | |
| with urllib.request.urlopen(req) as response: | |
| res = json.loads(response.read().decode('utf-8')) | |
| return res['choices']['message']['content'] | |
| except Exception as e: | |
| return f"Error connecting to AdamAi engine: {str(e)}" | |
| # Interface graphique générée par le navigateur | |
| with gr.Blocks(theme=gr.themes.Soft()) as demo: | |
| gr.Markdown("# 🤖 AdamAi Beta 1") | |
| gr.Markdown("Running completely serverless in your browser via Gradio-lite!") | |
| user_input = gr.Textbox(label="Write your question:", placeholder="Ask AdamAi anything...") | |
| output_text = gr.Textbox(label="AdamAi Answer:", lines=6) | |
| submit_btn = gr.Button("Ask AI", variant="primary") | |
| submit_btn.click(fn=ask_adam_ai, inputs=user_input, outputs=output_text) | |
| demo.launch() | |
| </main-python> | |
| </gradio-app> | |
| </body> | |
| </html> | |