Instructions to use itsalissonsilva/QuantumCoder-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use itsalissonsilva/QuantumCoder-9B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B") model = PeftModel.from_pretrained(base_model, "itsalissonsilva/QuantumCoder-9B") - Notebooks
- Google Colab
- Kaggle
Run intended offline public reproducer and verify every frozen base/adapter execution count
Browse files
reproducer_verification/reproduced_counts.json
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"versions": {
|
| 3 |
+
"qiskit": "2.2.3",
|
| 4 |
+
"pennylane": "0.43.1",
|
| 5 |
+
"cirq": "1.6.1"
|
| 6 |
+
},
|
| 7 |
+
"all_counts_reproduced": true,
|
| 8 |
+
"summary": {
|
| 9 |
+
"base/validation/all": {
|
| 10 |
+
"n": 144,
|
| 11 |
+
"passed": 16
|
| 12 |
+
},
|
| 13 |
+
"base/validation/qiskit": {
|
| 14 |
+
"n": 48,
|
| 15 |
+
"passed": 15
|
| 16 |
+
},
|
| 17 |
+
"base/validation/pennylane": {
|
| 18 |
+
"n": 48,
|
| 19 |
+
"passed": 0
|
| 20 |
+
},
|
| 21 |
+
"base/validation/cirq": {
|
| 22 |
+
"n": 48,
|
| 23 |
+
"passed": 1
|
| 24 |
+
},
|
| 25 |
+
"base/test_iid/all": {
|
| 26 |
+
"n": 288,
|
| 27 |
+
"passed": 36
|
| 28 |
+
},
|
| 29 |
+
"base/test_iid/qiskit": {
|
| 30 |
+
"n": 96,
|
| 31 |
+
"passed": 31
|
| 32 |
+
},
|
| 33 |
+
"base/test_iid/pennylane": {
|
| 34 |
+
"n": 96,
|
| 35 |
+
"passed": 3
|
| 36 |
+
},
|
| 37 |
+
"base/test_iid/cirq": {
|
| 38 |
+
"n": 96,
|
| 39 |
+
"passed": 2
|
| 40 |
+
},
|
| 41 |
+
"base/test_stress/all": {
|
| 42 |
+
"n": 288,
|
| 43 |
+
"passed": 47
|
| 44 |
+
},
|
| 45 |
+
"base/test_stress/qiskit": {
|
| 46 |
+
"n": 96,
|
| 47 |
+
"passed": 47
|
| 48 |
+
},
|
| 49 |
+
"base/test_stress/pennylane": {
|
| 50 |
+
"n": 96,
|
| 51 |
+
"passed": 0
|
| 52 |
+
},
|
| 53 |
+
"base/test_stress/cirq": {
|
| 54 |
+
"n": 96,
|
| 55 |
+
"passed": 0
|
| 56 |
+
},
|
| 57 |
+
"adapted/validation/all": {
|
| 58 |
+
"n": 144,
|
| 59 |
+
"passed": 144
|
| 60 |
+
},
|
| 61 |
+
"adapted/validation/qiskit": {
|
| 62 |
+
"n": 48,
|
| 63 |
+
"passed": 48
|
| 64 |
+
},
|
| 65 |
+
"adapted/validation/pennylane": {
|
| 66 |
+
"n": 48,
|
| 67 |
+
"passed": 48
|
| 68 |
+
},
|
| 69 |
+
"adapted/validation/cirq": {
|
| 70 |
+
"n": 48,
|
| 71 |
+
"passed": 48
|
| 72 |
+
},
|
| 73 |
+
"adapted/test_iid/all": {
|
| 74 |
+
"n": 288,
|
| 75 |
+
"passed": 288
|
| 76 |
+
},
|
| 77 |
+
"adapted/test_iid/qiskit": {
|
| 78 |
+
"n": 96,
|
| 79 |
+
"passed": 96
|
| 80 |
+
},
|
| 81 |
+
"adapted/test_iid/pennylane": {
|
| 82 |
+
"n": 96,
|
| 83 |
+
"passed": 96
|
| 84 |
+
},
|
| 85 |
+
"adapted/test_iid/cirq": {
|
| 86 |
+
"n": 96,
|
| 87 |
+
"passed": 96
|
| 88 |
+
},
|
| 89 |
+
"adapted/test_stress/all": {
|
| 90 |
+
"n": 288,
|
| 91 |
+
"passed": 282
|
| 92 |
+
},
|
| 93 |
+
"adapted/test_stress/qiskit": {
|
| 94 |
+
"n": 96,
|
| 95 |
+
"passed": 94
|
| 96 |
+
},
|
| 97 |
+
"adapted/test_stress/pennylane": {
|
| 98 |
+
"n": 96,
|
| 99 |
+
"passed": 93
|
| 100 |
+
},
|
| 101 |
+
"adapted/test_stress/cirq": {
|
| 102 |
+
"n": 96,
|
| 103 |
+
"passed": 95
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
}
|
reproducer_verification/train_quantum_v2_repro_pilot.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Run the public offline reproducer against the frozen private snapshot."""
|
| 2 |
+
import hashlib
|
| 3 |
+
import json
|
| 4 |
+
import os
|
| 5 |
+
import shutil
|
| 6 |
+
import subprocess
|
| 7 |
+
import sys
|
| 8 |
+
from pathlib import Path
|
| 9 |
+
from huggingface_hub import HfApi,hf_hub_download
|
| 10 |
+
|
| 11 |
+
REPO="itsalissonsilva/QuantumCoder-9B"
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def main():
|
| 15 |
+
api=HfApi();revision=api.model_info(REPO).sha
|
| 16 |
+
assert api.model_info(REPO).private
|
| 17 |
+
root=Path("/tmp/quantum-public-reproducer");root.mkdir(exist_ok=True)
|
| 18 |
+
for name in ["curriculum_v2/rows.json","curriculum_v2_run/generation_report.json",
|
| 19 |
+
"v2_execution/execution.json","v2_executor_preflight/preflight.json"]:
|
| 20 |
+
source=Path(hf_hub_download(REPO,name,revision=revision));target=root/name
|
| 21 |
+
target.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(source,target)
|
| 22 |
+
source=Path(hf_hub_download(REPO,"release_candidate/reproduce_execution.py",revision=revision))
|
| 23 |
+
shutil.copyfile(source,root/"reproduce_execution.py")
|
| 24 |
+
shutil.copyfile("/tmp/quantum_sandbox_v2.py",root/"quantum_sandbox_v2.py")
|
| 25 |
+
env={k:v for k,v in os.environ.items() if not any(s in k.upper() for s in ["TOKEN","SECRET","API_KEY","PASSWORD"])}
|
| 26 |
+
subprocess.run([sys.executable,str(root/"reproduce_execution.py")],cwd=root,env=env,check=True,timeout=600)
|
| 27 |
+
result=json.loads((root/"reproduced_counts.json").read_text())
|
| 28 |
+
assert result["all_counts_reproduced"]
|
| 29 |
+
output=Path("reproducer_verification");output.mkdir(exist_ok=True)
|
| 30 |
+
shutil.copyfile(root/"reproduced_counts.json",output/"reproduced_counts.json")
|
| 31 |
+
audit=dict(source_revision=revision,all_counts_reproduced=True,
|
| 32 |
+
reproducer_sha256=hashlib.sha256(source.read_bytes()).hexdigest(),
|
| 33 |
+
sandbox_sha256=hashlib.sha256((root/"quantum_sandbox_v2.py").read_bytes()).hexdigest())
|
| 34 |
+
(output/"verification.json").write_text(json.dumps(audit,indent=2))
|
| 35 |
+
(output/"train_quantum_v2_repro_pilot.py").write_bytes(Path(__file__).read_bytes())
|
| 36 |
+
commit=api.upload_folder(repo_id=REPO,folder_path=str(output),path_in_repo="reproducer_verification",
|
| 37 |
+
commit_message="Run intended offline public reproducer and verify every frozen base/adapter execution count")
|
| 38 |
+
print(json.dumps(dict(revision=commit.oid,**audit)),flush=True)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
if __name__=="__main__":main()
|
reproducer_verification/verification.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"source_revision": "beac1846b73ae0e7d08f7bb2ce2146e2eea87ccf",
|
| 3 |
+
"all_counts_reproduced": true,
|
| 4 |
+
"reproducer_sha256": "3a318196c0573529b17a71b3b861d96e7e023843b9a64924486886a808b9af0a",
|
| 5 |
+
"sandbox_sha256": "c98c9b97324b3d6304ca38204b3a2a0940a8f0c1dbe1a05f5fb9dd4e88634b85"
|
| 6 |
+
}
|