Spaces:
Sleeping
Sleeping
samples
Browse files
app.py
CHANGED
|
@@ -13,44 +13,169 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 13 |
# Model configuration
|
| 14 |
MODEL_NAME = "Plasmoxy/Qwen3-0.6B-DiscordSum-mini-v1"
|
| 15 |
|
| 16 |
-
# Sample
|
| 17 |
-
|
| 18 |
-
[
|
| 19 |
-
[
|
| 20 |
-
[
|
| 21 |
-
[
|
| 22 |
-
[
|
| 23 |
-
[
|
| 24 |
-
[
|
| 25 |
-
[
|
| 26 |
-
[
|
| 27 |
-
[
|
| 28 |
-
[
|
| 29 |
-
[
|
| 30 |
-
[
|
| 31 |
-
[
|
| 32 |
-
[
|
| 33 |
-
[
|
| 34 |
-
|
| 35 |
-
[
|
| 36 |
-
[
|
| 37 |
-
[
|
| 38 |
-
[
|
| 39 |
-
[
|
| 40 |
-
[
|
| 41 |
-
[
|
| 42 |
-
[
|
| 43 |
-
[
|
| 44 |
-
[
|
| 45 |
-
[
|
| 46 |
-
[
|
| 47 |
-
[
|
| 48 |
-
[
|
| 49 |
-
[
|
| 50 |
-
[
|
| 51 |
-
[
|
| 52 |
-
[
|
| 53 |
-
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
# Global model and tokenizer
|
| 56 |
model = None
|
|
@@ -218,7 +343,11 @@ demo = gr.Interface(
|
|
| 218 |
],
|
| 219 |
title="DiscordSum - Conversation Summarizer",
|
| 220 |
description="Summarize Discord conversations into short paragraphs. Runs [Plasmoxy/Qwen3-0.6B-DiscordSum-mini-v1](https://huggingface.co/Plasmoxy/Qwen3-0.6B-DiscordSum-mini-v1).",
|
| 221 |
-
examples=[
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
)
|
| 223 |
|
| 224 |
if __name__ == "__main__":
|
|
|
|
| 13 |
# Model configuration
|
| 14 |
MODEL_NAME = "Plasmoxy/Qwen3-0.6B-DiscordSum-mini-v1"
|
| 15 |
|
| 16 |
+
# Sample conversations for demo
|
| 17 |
+
SAMPLE_CONVERSATIONS = {
|
| 18 |
+
"Quick Bug Fix": """[Sarah]: Hey team, found a bug in the login form
|
| 19 |
+
[Mike]: What's the issue?
|
| 20 |
+
[Sarah]: The password field isn't validating minimum length
|
| 21 |
+
[Mike]: I'll fix that today, should be a quick patch
|
| 22 |
+
[Sarah]: Thanks! Let me know when it's ready for testing
|
| 23 |
+
[Tom]: Is this affecting production users?
|
| 24 |
+
[Sarah]: Not yet, caught it in staging
|
| 25 |
+
[Tom]: Good catch! We should add more validation tests
|
| 26 |
+
[Mike]: Just pushed the fix to dev branch
|
| 27 |
+
[Sarah]: Testing now... looks good!
|
| 28 |
+
[Tom]: Can you also check the email validation while you're at it?
|
| 29 |
+
[Sarah]: Sure, testing that too... email validation works fine
|
| 30 |
+
[Mike]: Great, I'll merge it to main
|
| 31 |
+
[Tom]: Don't forget to update the changelog
|
| 32 |
+
[Mike]: Already done, also added unit tests for this
|
| 33 |
+
[Sarah]: Perfect! This should prevent similar issues in the future""",
|
| 34 |
+
|
| 35 |
+
"Gaming Session": """[Alex]: Anyone up for some Valorant tonight?
|
| 36 |
+
[Jake]: I'm down! What time?
|
| 37 |
+
[Alex]: Around 8 PM?
|
| 38 |
+
[Emma]: Can I join? I'm still learning though
|
| 39 |
+
[Jake]: Of course! We can do unrated matches
|
| 40 |
+
[Alex]: Perfect, see you all at 8!
|
| 41 |
+
[Emma]: What agents should I practice?
|
| 42 |
+
[Jake]: Try Sage or Brimstone, they're beginner friendly
|
| 43 |
+
[Emma]: Thanks for the tips!
|
| 44 |
+
[Alex]: We'll help you learn the maps too
|
| 45 |
+
[Jake]: Emma, have you played any tactical shooters before?
|
| 46 |
+
[Emma]: A bit of CS:GO, but Valorant feels different
|
| 47 |
+
[Alex]: The abilities make it unique, but the shooting mechanics are similar
|
| 48 |
+
[Emma]: Should I focus on aim or learning abilities first?
|
| 49 |
+
[Jake]: Both, but start with crosshair placement and basic abilities
|
| 50 |
+
[Alex]: We can do some custom games first to practice
|
| 51 |
+
[Emma]: That sounds great! I don't want to drag the team down
|
| 52 |
+
[Jake]: Don't worry, we all started somewhere
|
| 53 |
+
[Alex]: Plus unrated is perfect for learning, no pressure""",
|
| 54 |
+
|
| 55 |
+
"Anime Discussion": """[Yuki]: Just finished the latest Attack on Titan episode!
|
| 56 |
+
[Marcus]: No spoilers! I'm still on season 3
|
| 57 |
+
[Yuki]: My lips are sealed 🤐
|
| 58 |
+
[Lisa]: The animation this season is incredible
|
| 59 |
+
[Yuki]: Right?! The studio really outdid themselves
|
| 60 |
+
[Marcus]: Okay now I'm excited to catch up
|
| 61 |
+
[Lisa]: The soundtrack is also amazing this season
|
| 62 |
+
[Yuki]: Agreed! That final scene gave me chills
|
| 63 |
+
[Marcus]: Stop, you're making me want to binge it all tonight
|
| 64 |
+
[Lisa]: Do it! You won't regret it
|
| 65 |
+
[Yuki]: The character development has been insane too
|
| 66 |
+
[Lisa]: I know! I didn't expect that plot twist at all
|
| 67 |
+
[Marcus]: OKAY STOPPING HERE, no more hints!
|
| 68 |
+
[Yuki]: Sorry sorry! But seriously, catch up soon so we can discuss
|
| 69 |
+
[Lisa]: Have you guys seen the new Demon Slayer movie yet?
|
| 70 |
+
[Yuki]: Not yet, is it good?
|
| 71 |
+
[Lisa]: Amazing! The fight scenes are breathtaking
|
| 72 |
+
[Marcus]: I heard the animation budget was huge
|
| 73 |
+
[Lisa]: You can tell, every frame is gorgeous
|
| 74 |
+
[Yuki]: We should all go watch it together next weekend""",
|
| 75 |
+
|
| 76 |
+
"Movie Night Planning": """[Chris]: Movie night this Friday?
|
| 77 |
+
[Sam]: Yes! What should we watch?
|
| 78 |
+
[Chris]: How about the new Dune movie?
|
| 79 |
+
[Taylor]: I'm in, but can we do Saturday instead?
|
| 80 |
+
[Sam]: Saturday works better for me too
|
| 81 |
+
[Chris]: Saturday it is then, 7 PM at my place
|
| 82 |
+
[Taylor]: Should we bring snacks?
|
| 83 |
+
[Chris]: I'll handle popcorn, you guys bring drinks
|
| 84 |
+
[Sam]: I'll bring some sodas and chips
|
| 85 |
+
[Taylor]: I'll make my famous nachos!
|
| 86 |
+
[Chris]: Perfect, this is going to be awesome
|
| 87 |
+
[Sam]: Should we watch the first Dune movie before?
|
| 88 |
+
[Chris]: Good idea! We could start at 4 PM with the first one
|
| 89 |
+
[Taylor]: That's a long movie marathon, I'm so in!
|
| 90 |
+
[Sam]: Do we need to read the books first?
|
| 91 |
+
[Chris]: Nah, the movies are great on their own
|
| 92 |
+
[Taylor]: I'll bring my projector if you want a bigger screen
|
| 93 |
+
[Chris]: Oh that would be amazing! My TV is only 55 inches
|
| 94 |
+
[Sam]: This is turning into a proper cinema experience
|
| 95 |
+
[Taylor]: Should I bring my surround sound speakers too?
|
| 96 |
+
[Chris]: Yes please! Let's go all out
|
| 97 |
+
[Sam]: I'll make sure to bring extra snacks then
|
| 98 |
+
[Taylor]: Can't wait! This is going to be epic
|
| 99 |
+
[Chris]: Best movie night ever incoming!
|
| 100 |
+
[Sam]: Should we invite anyone else?
|
| 101 |
+
[Chris]: Let's keep it small, my living room isn't huge
|
| 102 |
+
[Taylor]: Fair enough, cozy movie night with the crew
|
| 103 |
+
[Sam]: Perfect! See you all Saturday at 4 PM""",
|
| 104 |
+
|
| 105 |
+
"Recipe Sharing": """[Mom_Chef]: Just made the best chocolate chip cookies!
|
| 106 |
+
[FoodieFan]: Recipe please! 🍪
|
| 107 |
+
[Mom_Chef]: 2 cups flour, 1 cup butter, 1 cup sugar, chocolate chips
|
| 108 |
+
[FoodieFan]: What temperature?
|
| 109 |
+
[Mom_Chef]: 350°F for 12 minutes
|
| 110 |
+
[FoodieFan]: Making these tonight, thanks!
|
| 111 |
+
[Mom_Chef]: Don't forget to cream the butter and sugar first
|
| 112 |
+
[FoodieFan]: How long should I cream them?
|
| 113 |
+
[Mom_Chef]: About 3-4 minutes until fluffy
|
| 114 |
+
[FoodieFan]: Got it! Any other tips?
|
| 115 |
+
[Mom_Chef]: Let the dough chill for 30 minutes before baking
|
| 116 |
+
[FoodieFan]: You're the best!
|
| 117 |
+
[BakingQueen]: Can I get that recipe too?
|
| 118 |
+
[Mom_Chef]: Of course! Also add 2 eggs and 1 tsp vanilla extract
|
| 119 |
+
[BakingQueen]: What kind of chocolate chips work best?
|
| 120 |
+
[Mom_Chef]: I use semi-sweet, but dark chocolate works great too
|
| 121 |
+
[FoodieFan]: Can I add nuts?
|
| 122 |
+
[Mom_Chef]: Absolutely! Walnuts or pecans are perfect
|
| 123 |
+
[BakingQueen]: How many cookies does this make?
|
| 124 |
+
[Mom_Chef]: About 36 medium-sized cookies
|
| 125 |
+
[FoodieFan]: Can I freeze the dough?
|
| 126 |
+
[Mom_Chef]: Yes! It freezes beautifully for up to 3 months
|
| 127 |
+
[BakingQueen]: Do you use salted or unsalted butter?
|
| 128 |
+
[Mom_Chef]: Unsalted, then add 1 tsp of salt to the dry ingredients
|
| 129 |
+
[FoodieFan]: Should the butter be room temperature?
|
| 130 |
+
[Mom_Chef]: Yes, soft but not melted
|
| 131 |
+
[BakingQueen]: Thanks for all the details! Making these this weekend
|
| 132 |
+
[FoodieFan]: Just put mine in the oven, house smells amazing already!
|
| 133 |
+
[Mom_Chef]: Let me know how they turn out!
|
| 134 |
+
[FoodieFan]: They're perfect! Crispy edges, soft center
|
| 135 |
+
[BakingQueen]: Now I'm even more excited to try them
|
| 136 |
+
[Mom_Chef]: So happy they worked out! Enjoy everyone!""",
|
| 137 |
+
|
| 138 |
+
"Study Group": """[Student1]: Can someone explain the calculus homework?
|
| 139 |
+
[Student2]: Which problem are you stuck on?
|
| 140 |
+
[Student1]: Problem 5, the integration one
|
| 141 |
+
[Student2]: You need to use substitution method there
|
| 142 |
+
[Student1]: Oh! That makes sense now
|
| 143 |
+
[Student2]: Want to meet up tomorrow to go over the rest?
|
| 144 |
+
[Student1]: That would be great, thanks!
|
| 145 |
+
[Student3]: Can I join too? I'm struggling with problem 7
|
| 146 |
+
[Student2]: Sure! Let's meet at the library at 3 PM
|
| 147 |
+
[Student1]: Perfect, see you there
|
| 148 |
+
[Student3]: Thanks guys, really appreciate it
|
| 149 |
+
[Student2]: No problem, we're all in this together
|
| 150 |
+
[Student4]: Is this for Professor Johnson's class?
|
| 151 |
+
[Student1]: Yes! Are you in that class too?
|
| 152 |
+
[Student4]: Yeah, I'm also confused about problem 8
|
| 153 |
+
[Student2]: We can go over that one tomorrow as well
|
| 154 |
+
[Student3]: Should we bring our textbooks?
|
| 155 |
+
[Student2]: Definitely, and your notes too
|
| 156 |
+
[Student1]: I'll bring my laptop in case we need to look anything up
|
| 157 |
+
[Student4]: Can we also review the previous chapter? I'm still shaky on that
|
| 158 |
+
[Student2]: Good idea, the concepts build on each other
|
| 159 |
+
[Student3]: What about problem 10? That one seems really hard
|
| 160 |
+
[Student1]: I haven't even attempted that one yet
|
| 161 |
+
[Student2]: It's tricky but we'll work through it together
|
| 162 |
+
[Student4]: Should we plan for more than an hour?
|
| 163 |
+
[Student2]: Probably, let's say 2-3 hours to be safe
|
| 164 |
+
[Student3]: I can stay until 6 PM if needed
|
| 165 |
+
[Student1]: Same here, I really want to understand this material
|
| 166 |
+
[Student4]: This study group is a lifesaver
|
| 167 |
+
[Student2]: We should make this a regular thing
|
| 168 |
+
[Student3]: Agreed! Maybe every week before assignments are due?
|
| 169 |
+
[Student1]: I'm in! Let's create a group chat
|
| 170 |
+
[Student4]: Great idea, I'll set one up
|
| 171 |
+
[Student2]: Perfect! See everyone tomorrow at 3 PM, library second floor
|
| 172 |
+
[Student1]: Thanks everyone, feeling much better about this now
|
| 173 |
+
[Student3]: Same! Can't wait to finally understand these problems
|
| 174 |
+
[Student4]: This is why study groups are the best!"""
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
# Default conversation for initial load
|
| 178 |
+
SAMPLE_CONVERSATION = SAMPLE_CONVERSATIONS["Quick Bug Fix"]
|
| 179 |
|
| 180 |
# Global model and tokenizer
|
| 181 |
model = None
|
|
|
|
| 343 |
],
|
| 344 |
title="DiscordSum - Conversation Summarizer",
|
| 345 |
description="Summarize Discord conversations into short paragraphs. Runs [Plasmoxy/Qwen3-0.6B-DiscordSum-mini-v1](https://huggingface.co/Plasmoxy/Qwen3-0.6B-DiscordSum-mini-v1).",
|
| 346 |
+
examples=[
|
| 347 |
+
[SAMPLE_CONVERSATIONS["Quick Bug Fix"]],
|
| 348 |
+
[SAMPLE_CONVERSATIONS["Gaming Session"]],
|
| 349 |
+
[SAMPLE_CONVERSATIONS["Study Group"]],
|
| 350 |
+
],
|
| 351 |
)
|
| 352 |
|
| 353 |
if __name__ == "__main__":
|