MCPcopy
hub / github.com/huggingface/diffusers / main

Function main

utils/label_issues.py:86–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84
85
86def main():
87 try:
88 title = os.environ.get("ISSUE_TITLE", "")
89 body = os.environ.get("ISSUE_BODY", "")
90
91 client = InferenceClient(api_key=os.environ["HF_TOKEN"])
92
93 completion = client.chat.completions.create(
94 model=os.environ.get("HF_MODEL", "Qwen/Qwen3.5-35B-A3B"),
95 messages=[
96 {"role": "system", "content": SYSTEM_PROMPT},
97 {"role": "user", "content": USER_TEMPLATE.format(title=title, body=body)},
98 ],
99 response_format={"type": "json_object"},
100 temperature=0,
101 )
102
103 response = completion.choices[0].message.content.strip()
104 result = json.loads(response)
105
106 labels = [l for l in result["labels"] if l in VALID_LABELS]
107 model_name = result.get("model_name")
108
109 if model_name:
110 existing = get_existing_components()
111 if not any(model_name.lower() in name for name in existing):
112 labels.append("new-pipeline/model")
113
114 if "bug" in labels and "Diffusers version:" not in body:
115 labels.append("needs-env-info")
116
117 print(json.dumps(labels))
118 except Exception:
119 print("Labeling failed", file=sys.stderr)
120
121
122if __name__ == "__main__":

Callers 1

label_issues.pyFile · 0.70

Calls 3

get_existing_componentsFunction · 0.85
getMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…