Upload folder using huggingface_hub
Browse files
README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: indigo
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 5.22.0
|
8 |
-
app_file:
|
9 |
pinned: false
|
|
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
+
|
2 |
---
|
3 |
+
title: markdown_with_mermaid_main
|
4 |
+
emoji: 🔥
|
5 |
colorFrom: indigo
|
6 |
+
colorTo: indigo
|
7 |
sdk: gradio
|
8 |
sdk_version: 5.22.0
|
9 |
+
app_file: run.py
|
10 |
pinned: false
|
11 |
+
hf_oauth: true
|
12 |
---
|
|
|
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
gradio-client @ git+https://github.com/gradio-app/gradio@1649b0038482402d7f0ccdbf86ba65d82b4a12c9#subdirectory=client/python
|
2 |
+
https://gradio-pypi-previews.s3.amazonaws.com/1649b0038482402d7f0ccdbf86ba65d82b4a12c9/gradio-5.22.0-py3-none-any.whl
|
run.ipynb
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: markdown_with_mermaid"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "demo = gr.Blocks()\n", "\n", "with demo:\n", " gr.Markdown(\n", " \"\"\"\n", " # Project Documentation with Mermaid Diagrams\n", " \n", " This example demonstrates how to combine regular Markdown with Mermaid diagrams for better visualization.\n", " \n", " ## System Architecture\n", " \n", " Below is an overview of our system's architecture:\n", " \n", " ```mermaid\n", " graph LR\n", " User[User] --> Frontend[Web Frontend]\n", " Frontend --> API[API Gateway]\n", " API --> Auth[Authentication Service]\n", " API --> DataService[Data Processing Service]\n", " DataService --> DB[(Database)]\n", " DataService --> ML[Machine Learning Engine]\n", " ML --> Model[(Model Storage)]\n", " \n", " style User fill:#f9f,stroke:#333,stroke-width:2px\n", " style Frontend fill:#bbf,stroke:#333,stroke-width:2px\n", " style API fill:#bfb,stroke:#333,stroke-width:2px\n", " style DataService fill:#fbb,stroke:#333,stroke-width:2px\n", " ```\n", " \n", " ## Data Processing Workflow\n", " \n", " The data goes through the following steps before reaching the end user:\n", " \n", " 1. Collection from various sources\n", " 2. Cleaning and preprocessing\n", " 3. Feature extraction\n", " 4. Analysis and model application\n", " 5. Results formatting\n", " \n", " ## User Journey\n", " \n", " ```mermaid\n", " sequenceDiagram\n", " participant U as User\n", " participant F as Frontend\n", " participant A as API\n", " participant D as Database\n", " \n", " U->>F: Login Request\n", " F->>A: Authenticate\n", " A->>D: Verify Credentials\n", " D-->>A: User Validated\n", " A-->>F: Auth Token\n", " F-->>U: Login Success\n", " \n", " U->>F: Request Data\n", " F->>A: Get Data (with token)\n", " A->>D: Query Data\n", " D-->>A: Return Results\n", " A-->>F: Formatted Data\n", " F-->>U: Display Results\n", " ```\n", " \n", " ## Decision Process\n", " \n", " When handling requests, our system follows this decision tree:\n", " \n", " ```mermaid\n", " flowchart TD\n", " A[New Request] --> B{Authenticated?}\n", " B -->|Yes| C{Request Type}\n", " B -->|No| D[Return 401]\n", " \n", " C -->|Data Query| E[Process Query]\n", " C -->|Update| F{Has Permission?}\n", " C -->|Delete| G{Is Admin?}\n", " \n", " F -->|Yes| H[Apply Update]\n", " F -->|No| I[Return 403]\n", " \n", " G -->|Yes| J[Execute Delete]\n", " G -->|No| K[Return 403]\n", " \n", " E --> L[Return Data]\n", " H --> M[Return Success]\n", " J --> N[Return Success]\n", " \n", " style A fill:#98fb98,stroke:#333\n", " style D fill:#ff9999,stroke:#333\n", " style I fill:#ff9999,stroke:#333\n", " style K fill:#ff9999,stroke:#333\n", " style M fill:#98fb98,stroke:#333\n", " style N fill:#98fb98,stroke:#333\n", " ```\n", " \n", " ## State Diagram\n", " \n", " Our application transitions through these states:\n", " \n", " ```mermaid\n", " stateDiagram-v2\n", " [*] --> Initialization\n", " Initialization --> Ready\n", " \n", " Ready --> Processing: New Request\n", " Processing --> Error: Exception\n", " Processing --> Complete: Success\n", " \n", " Error --> Ready: Reset\n", " Complete --> Ready: Reset\n", " \n", " Ready --> Shutdown: Exit Command\n", " Shutdown --> [*]\n", " ```\n", " \n", " ## Additional Resources\n", " \n", " For more information about our system, please check:\n", " \n", " - [API Documentation](https://example.com/api-docs)\n", " - [User Guide](https://example.com/user-guide)\n", " - [Admin Dashboard](https://example.com/admin)\n", " \"\"\"\n", " )\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
demo = gr.Blocks()
|
4 |
+
|
5 |
+
with demo:
|
6 |
+
gr.Markdown(
|
7 |
+
"""
|
8 |
+
# Project Documentation with Mermaid Diagrams
|
9 |
+
|
10 |
+
This example demonstrates how to combine regular Markdown with Mermaid diagrams for better visualization.
|
11 |
+
|
12 |
+
## System Architecture
|
13 |
+
|
14 |
+
Below is an overview of our system's architecture:
|
15 |
+
|
16 |
+
```mermaid
|
17 |
+
graph LR
|
18 |
+
User[User] --> Frontend[Web Frontend]
|
19 |
+
Frontend --> API[API Gateway]
|
20 |
+
API --> Auth[Authentication Service]
|
21 |
+
API --> DataService[Data Processing Service]
|
22 |
+
DataService --> DB[(Database)]
|
23 |
+
DataService --> ML[Machine Learning Engine]
|
24 |
+
ML --> Model[(Model Storage)]
|
25 |
+
|
26 |
+
style User fill:#f9f,stroke:#333,stroke-width:2px
|
27 |
+
style Frontend fill:#bbf,stroke:#333,stroke-width:2px
|
28 |
+
style API fill:#bfb,stroke:#333,stroke-width:2px
|
29 |
+
style DataService fill:#fbb,stroke:#333,stroke-width:2px
|
30 |
+
```
|
31 |
+
|
32 |
+
## Data Processing Workflow
|
33 |
+
|
34 |
+
The data goes through the following steps before reaching the end user:
|
35 |
+
|
36 |
+
1. Collection from various sources
|
37 |
+
2. Cleaning and preprocessing
|
38 |
+
3. Feature extraction
|
39 |
+
4. Analysis and model application
|
40 |
+
5. Results formatting
|
41 |
+
|
42 |
+
## User Journey
|
43 |
+
|
44 |
+
```mermaid
|
45 |
+
sequenceDiagram
|
46 |
+
participant U as User
|
47 |
+
participant F as Frontend
|
48 |
+
participant A as API
|
49 |
+
participant D as Database
|
50 |
+
|
51 |
+
U->>F: Login Request
|
52 |
+
F->>A: Authenticate
|
53 |
+
A->>D: Verify Credentials
|
54 |
+
D-->>A: User Validated
|
55 |
+
A-->>F: Auth Token
|
56 |
+
F-->>U: Login Success
|
57 |
+
|
58 |
+
U->>F: Request Data
|
59 |
+
F->>A: Get Data (with token)
|
60 |
+
A->>D: Query Data
|
61 |
+
D-->>A: Return Results
|
62 |
+
A-->>F: Formatted Data
|
63 |
+
F-->>U: Display Results
|
64 |
+
```
|
65 |
+
|
66 |
+
## Decision Process
|
67 |
+
|
68 |
+
When handling requests, our system follows this decision tree:
|
69 |
+
|
70 |
+
```mermaid
|
71 |
+
flowchart TD
|
72 |
+
A[New Request] --> B{Authenticated?}
|
73 |
+
B -->|Yes| C{Request Type}
|
74 |
+
B -->|No| D[Return 401]
|
75 |
+
|
76 |
+
C -->|Data Query| E[Process Query]
|
77 |
+
C -->|Update| F{Has Permission?}
|
78 |
+
C -->|Delete| G{Is Admin?}
|
79 |
+
|
80 |
+
F -->|Yes| H[Apply Update]
|
81 |
+
F -->|No| I[Return 403]
|
82 |
+
|
83 |
+
G -->|Yes| J[Execute Delete]
|
84 |
+
G -->|No| K[Return 403]
|
85 |
+
|
86 |
+
E --> L[Return Data]
|
87 |
+
H --> M[Return Success]
|
88 |
+
J --> N[Return Success]
|
89 |
+
|
90 |
+
style A fill:#98fb98,stroke:#333
|
91 |
+
style D fill:#ff9999,stroke:#333
|
92 |
+
style I fill:#ff9999,stroke:#333
|
93 |
+
style K fill:#ff9999,stroke:#333
|
94 |
+
style M fill:#98fb98,stroke:#333
|
95 |
+
style N fill:#98fb98,stroke:#333
|
96 |
+
```
|
97 |
+
|
98 |
+
## State Diagram
|
99 |
+
|
100 |
+
Our application transitions through these states:
|
101 |
+
|
102 |
+
```mermaid
|
103 |
+
stateDiagram-v2
|
104 |
+
[*] --> Initialization
|
105 |
+
Initialization --> Ready
|
106 |
+
|
107 |
+
Ready --> Processing: New Request
|
108 |
+
Processing --> Error: Exception
|
109 |
+
Processing --> Complete: Success
|
110 |
+
|
111 |
+
Error --> Ready: Reset
|
112 |
+
Complete --> Ready: Reset
|
113 |
+
|
114 |
+
Ready --> Shutdown: Exit Command
|
115 |
+
Shutdown --> [*]
|
116 |
+
```
|
117 |
+
|
118 |
+
## Additional Resources
|
119 |
+
|
120 |
+
For more information about our system, please check:
|
121 |
+
|
122 |
+
- [API Documentation](https://example.com/api-docs)
|
123 |
+
- [User Guide](https://example.com/user-guide)
|
124 |
+
- [Admin Dashboard](https://example.com/admin)
|
125 |
+
"""
|
126 |
+
)
|
127 |
+
|
128 |
+
if __name__ == "__main__":
|
129 |
+
demo.launch()
|