Rahul-8799 commited on
Commit
9db2515
·
verified ·
1 Parent(s): c805c34

Delete quality_assurance_agent.py

Browse files
Files changed (1) hide show
  1. quality_assurance_agent.py +0 -44
quality_assurance_agent.py DELETED
@@ -1,44 +0,0 @@
1
- from transformers import AutoTokenizer, AutoModelForCausalLM
2
- import torch
3
- from langchain_core.messages import AIMessage
4
-
5
- MODEL_REPO = "Rahul-8799/quality_assurance_stablecode"
6
-
7
- tokenizer = AutoTokenizer.from_pretrained(MODEL_REPO, trust_remote_code=True)
8
- model = AutoModelForCausalLM.from_pretrained(
9
- MODEL_REPO,
10
- torch_dtype=torch.float16,
11
- device_map="auto"
12
- )
13
-
14
- def run(state: dict) -> dict:
15
- """Reviews UI/UX implementation and suggests improvements for better user experience"""
16
- messages = state["messages"]
17
- prompt = messages[-1].content
18
-
19
- # Enhance the prompt with UI/UX quality checks
20
- enhanced_prompt = f"""
21
- Review the UI implementation and check for:
22
- 1. Proper spacing and alignment
23
- 2. Consistent styling and theming
24
- 3. Responsive design implementation
25
- 4. Accessibility compliance
26
- 5. Visual hierarchy
27
- 6. Component reusability
28
- 7. Performance optimization
29
- 8. Cross-browser compatibility
30
- 9. Mobile responsiveness
31
- 10. User interaction patterns
32
-
33
- Original code: {prompt}
34
- """
35
-
36
- input_ids = tokenizer(enhanced_prompt, return_tensors="pt").input_ids.to(model.device)
37
- output_ids = model.generate(input_ids, max_new_tokens=3000)
38
- output = tokenizer.decode(output_ids[0], skip_special_tokens=True)
39
-
40
- return {
41
- "messages": [AIMessage(content=output)],
42
- "chat_log": state["chat_log"] + [{"role": "Quality Assurance", "content": output}],
43
- "qa_output": output,
44
- }