Plasmoxy commited on
Commit
1edd603
·
1 Parent(s): fd63352
Files changed (1) hide show
  1. app.py +168 -39
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 conversation for demo
17
- SAMPLE_CONVERSATION = """[TechLead_Sarah]: Good morning team! We need to discuss the upcoming Q1 release. There are some critical issues that came up during yesterday's sprint review.
18
- [Backend_Mike]: Morning! Yeah, I noticed the authentication service is having intermittent failures in staging. We're seeing about 5% of login attempts timing out.
19
- [DevOps_Chen]: I can confirm that. The logs show connection pool exhaustion during peak load. We might need to increase the max connections or implement better connection recycling.
20
- [Frontend_Emma]: That explains the user complaints we've been getting. Is this affecting the password reset flow too?
21
- [Backend_Mike]: Good question. Let me check... yes, it looks like any endpoint that touches the auth service is affected. Password resets, token refreshes, and social login callbacks.
22
- [TechLead_Sarah]: This is a P0 issue then. Mike, can you take the lead on fixing this? We need it resolved before the release.
23
- [Backend_Mike]: Absolutely. I'll start by profiling the connection usage patterns. Chen, can you help me analyze the infrastructure metrics?
24
- [DevOps_Chen]: Sure thing. I'll pull the CloudWatch data and set up a dashboard. Should have something by end of day.
25
- [QA_Alex]: While we're on critical issues, I found a data corruption bug in the export feature. When users export large datasets (>10k rows), some columns are getting scrambled.
26
- [Backend_Mike]: Oh no, that sounds serious. Do you have reproduction steps?
27
- [QA_Alex]: Yes, I documented everything in JIRA ticket ENG-2847. Happens consistently with the customer data export when you select more than 5 columns and filter by date range.
28
- [Frontend_Emma]: I worked on that feature last month. Let me take a look at the ticket. It might be related to how we're chunking the data before sending it to the backend.
29
- [TechLead_Sarah]: Emma, pair with Alex on this one. We can't ship with data corruption issues. What's the ETA on a fix?
30
- [Frontend_Emma]: Give me a few hours to investigate. If it's what I think it is, should be a quick fix in the data serialization logic.
31
- [Product_Manager_Lisa]: Just joining - are these issues going to delay our release? We have customer commitments for next Friday.
32
- [TechLead_Sarah]: Too early to say definitively, but we're treating both as blockers. Lisa, can you give us until tomorrow morning to assess the scope?
33
- [Product_Manager_Lisa]: Tomorrow morning works. I'll prepare a communication plan for customers in case we need to push back the date.
34
- [DevOps_Chen]: One more thing - our staging environment is going to undergo scheduled maintenance tonight from 11 PM to 2 AM EST. Just a heads up for anyone planning to work late.
35
- [Backend_Mike]: Thanks for the notice. I'll do my connection pool testing before then.
36
- [Security_James]: Hey folks, not to pile on, but I need to mention that our security audit identified some concerns with how we're handling API keys in the logging system. We're potentially exposing sensitive tokens in debug logs.
37
- [TechLead_Sarah]: James, is this something that needs immediate attention or can it wait until after the release?
38
- [Security_James]: It's not being actively exploited, but it's a significant vulnerability. I'd recommend we fix it this sprint. I can prepare a PR that redacts sensitive data from logs.
39
- [Backend_Mike]: I can review that PR. Should be straightforward - we just need to update our logging middleware.
40
- [Frontend_Emma]: Sarah, should we schedule a follow-up meeting to go through all these items in detail?
41
- [TechLead_Sarah]: Yes, let's do a quick sync at 2 PM today. I'll send out a calendar invite. Priority items: auth service failures, data export corruption, and security logging issue.
42
- [QA_Alex]: I'll prepare a full regression test plan for the auth service fix. We need to make sure we don't break anything else.
43
- [DevOps_Chen]: I'll also set up automated load testing for the auth service so we can catch these issues earlier in the future.
44
- [Product_Manager_Lisa]: Appreciate everyone jumping on this. I'll be in the 2 PM meeting with updates from the customer success team.
45
- [Backend_Mike]: Quick question - do we have any insight into when the auth issues started? Was it after the last deployment?
46
- [DevOps_Chen]: Looking at the metrics now... it started appearing about 4 days ago, which coincides with our database migration to the new instance type.
47
- [Backend_Mike]: Ah! That's a crucial data point. The new instance might have different connection limits or network characteristics.
48
- [DevOps_Chen]: Exactly what I was thinking. I'll check the RDS configuration and compare it with our old setup.
49
- [TechLead_Sarah]: Great detective work. Let's keep this thread updated with findings. Mike and Chen, prioritize the auth issue. Emma and Alex, focus on the export bug. James, get that security PR ready for review.
50
- [Security_James]: Will do. I'll have it ready by noon.
51
- [Frontend_Emma]: Alex, I'm looking at your ticket now. Can you jump on a quick call to walk me through the reproduction?
52
- [QA_Alex]: Sure, sending you a Zoom link now.
53
- [TechLead_Sarah]: Thanks everyone for the quick response. Let's crush these bugs and get back on track for the release!"""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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=[[SAMPLE_CONVERSATION]],
 
 
 
 
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__":