Text Generation
PEFT
Safetensors
English
pyspark
data-engineering
code-generation
qlora
lora
delta-lake
conversational
Instructions to use hoodarunner/pyspark-coding-assistant-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use hoodarunner/pyspark-coding-assistant-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3") model = PeftModel.from_pretrained(base_model, "hoodarunner/pyspark-coding-assistant-lora") - Notebooks
- Google Colab
- Kaggle
| id: nested_explode_outer_empty | |
| category: schema_nested | |
| difficulty: medium | |
| probes: > | |
| explode() drops rows whose array is empty or null; explode_outer() keeps them | |
| with a NULL element. The fixture contains one empty array and one null array, | |
| so the two functions give different row counts. | |
| tags: [explode, arrays, null_semantics] | |
| prompt: | | |
| Flatten the tags array in `docs` so there is one row per tag, KEEPING documents | |
| that have an empty or null tags array (their tag should be null). | |
| Return columns: doc_id, tag. | |
| fixtures: | |
| - name: docs | |
| schema: doc_id INT, tags ARRAY<STRING> | |
| rows: | |
| - [1, ["x", "y"]] | |
| - [2, []] | |
| - [3, null] | |
| - [4, ["z"]] | |
| solution: | | |
| from pyspark.sql import functions as F | |
| def solve(spark, docs): | |
| # explode() would silently drop docs 2 and 3. | |
| return docs.select("doc_id", F.explode_outer("tags").alias("tag")) | |
| compare: | |
| mode: rows | |