Spaces:
Running
on
Zero
Running
on
Zero
Create ui.py
#2
by
pabloce
- opened
ui.py
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
css = """
|
2 |
+
.message-row {
|
3 |
+
justify-content: space-evenly !important;
|
4 |
+
}
|
5 |
+
.message-bubble-border {
|
6 |
+
border-radius: 6px !important;
|
7 |
+
}
|
8 |
+
.message-buttons-bot, .message-buttons-user {
|
9 |
+
right: 10px !important;
|
10 |
+
left: auto !important;
|
11 |
+
bottom: 2px !important;
|
12 |
+
}
|
13 |
+
.dark.message-bubble-border {
|
14 |
+
border-color: #15172c !important;
|
15 |
+
}
|
16 |
+
.dark.user {
|
17 |
+
background: #10132c !important;
|
18 |
+
}
|
19 |
+
.dark.assistant.dark, .dark.pending.dark {
|
20 |
+
background: #020417 !important;
|
21 |
+
}
|
22 |
+
"""
|
23 |
+
|
24 |
+
PLACEHOLDER = """
|
25 |
+
<div class="message-bubble-border" style="display:flex; max-width: 600px; border-width: 1px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); backdrop-filter: blur(10px);">
|
26 |
+
<figure style="margin: 0;">
|
27 |
+
<img src="https://i.imgur.com/ZHwzQvI.png" alt="Logo" style="width: 100%; height: 100%; border-radius: 8px;">
|
28 |
+
</figure>
|
29 |
+
<div style="padding: .5rem 1.5rem;">
|
30 |
+
<h2 style="text-align: left; font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem;">Fine-tune Llama 3 with ORPO</h2>
|
31 |
+
<p style="text-align: left; font-size: 16px; line-height: 1.5; margin-bottom: 15px;">ORPO is a **new exciting fine-tuning technique** that combines the traditional supervised fine-tuning and preference alignment stages into a single process.</p>
|
32 |
+
<div style="display: flex; justify-content: space-between; align-items: center;">
|
33 |
+
<div style="display: flex; flex-flow: column; justify-content: space-between;">
|
34 |
+
<span style="display: inline-flex; align-items: center; border-radius: 0.375rem; background-color: rgba(79, 70, 229, 0.1); padding: 0.1rem 0.75rem; font-size: 0.75rem; font-weight: 500; color: #60a5fa; margin-top: 2.5px;">
|
35 |
+
OrpoLlama-3-8B
|
36 |
+
</span>
|
37 |
+
</div>
|
38 |
+
<div style="display: flex; justify-content: flex-end; align-items: center;">
|
39 |
+
<a href="https://mlabonne.github.io/blog/posts/2024-04-19_Fine_tune_Llama_3_with_ORPO.html" target="_blank" rel="noreferrer" style="padding: .5rem;">
|
40 |
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" width="28" height="28" >
|
41 |
+
<title>Website</title>
|
42 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="m6.115 5.19.319 1.913A6 6 0 0 0 8.11 10.36L9.75 12l-.387.775c-.217.433-.132.956.21 1.298l1.348 1.348c.21.21.329.497.329.795v1.089c0 .426.24.815.622 1.006l.153.076c.433.217.956.132 1.298-.21l.723-.723a8.7 8.7 0 0 0 2.288-4.042 1.087 1.087 0 0 0-.358-1.099l-1.33-1.108c-.251-.21-.582-.299-.905-.245l-1.17.195a1.125 1.125 0 0 1-.98-.314l-.295-.295a1.125 1.125 0 0 1 0-1.591l.13-.132a1.125 1.125 0 0 1 1.3-.21l.603.302a.809.809 0 0 0 1.086-1.086L14.25 7.5l1.256-.837a4.5 4.5 0 0 0 1.528-1.732l.146-.292M6.115 5.19A9 9 0 1 0 17.18 4.64M6.115 5.19A8.965 8.965 0 0 1 12 3c1.929 0 3.716.607 5.18 1.64" />
|
43 |
+
</svg>
|
44 |
+
|
45 |
+
</a>
|
46 |
+
<a href="https://github.com/mlabonne" target="_blank" rel="noreferrer" style="padding: .5rem;">
|
47 |
+
<svg width="24" height="24" fill="currentColor" viewBox="3 3 18 18">
|
48 |
+
<title>GitHub</title>
|
49 |
+
<path d="M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z"></path>
|
50 |
+
</svg>
|
51 |
+
</a>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
"""
|