Spaces:
Runtime error
Runtime error
recover mess
Browse filesFiles changed (2)
44 unmodified lines4546474849505174 unmodified lines126127128129130131132133134135136137138139140141142143144145146147148149150151224 unmodified lines37637737837938038138244 unmodified lines# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ# CONFIG# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββSIM_DEFAULT = 0.78 # Jaccard similarity thresholdPIXEL_MIN_HITS = 0 # multimodal trigger ("pixel_values")HTML_DEFAULT = "d3_modular_graph.html"74 unmodified linestexts[name] = code.strip() or " "names = list(texts)names = names[:90] # Limit before processingall_embeddings = []print(f"Encoding embeddings for {len(names)} models...")batch_size = 8for i in tqdm(range(0, len(names), batch_size), desc="Models", leave=False):model_name = names[i]text_len = len(texts[model_name])try:print(f"Processing {model_name} (text length: {text_len})")batch = [texts[model_name]]emb = model.encode(batch, convert_to_numpy=True, show_progress_bar=False)all_embeddings.append(emb)print(f"β Completed {model_name}")except Exception as e:print(f"β οΈ GPU worker error for {model_name}: {type(e).__name__}: {e}")# Create zero embedding as placeholder to maintain consistencyzero_emb = np.zeros((1, model.get_sentence_embedding_dimension()), dtype=np.float32)all_embeddings.append(zero_emb)embeddings = np.vstack(all_embeddings).astype(np.float32)224 unmodified lines}document.getElementById('toggleRed').addEventListener('change', updateVisibility);const HF_LOGO_URI = "hf-logo.png";const graph = __GRAPH_DATA__;const W = innerWidth, H = innerHeight;const svg = d3.select('#dependency').call(d3.zoom().on('zoom', e => g.attr('transform', e.transform)));44 unmodified lines4546474849505174 unmodified lines126127128129130131132133134135136137138139140141142143144145146147148149224 unmodified lines37437537637737837938044 unmodified lines# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ# CONFIG# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββSIM_DEFAULT = 0.5 # similarity thresholdPIXEL_MIN_HITS = 0 # multimodal trigger ("pixel_values")HTML_DEFAULT = "d3_modular_graph.html"74 unmodified linestexts[name] = code.strip() or " "names = list(texts)all_embeddings = []print(f"Encoding embeddings for {len(names)} models...")batch_size = 8for i in tqdm(range(0, len(names), batch_size), desc="Batches", leave=False):batch_names = names[i:i+batch_size]batch_texts = [texts[name] for name in batch_names]try:print(f"Processing batch: {batch_names}")emb = model.encode(batch_texts, convert_to_numpy=True, show_progress_bar=False)all_embeddings.append(emb)print(f"β Completed batch of {len(batch_names)} models")except Exception as e:print(f"β οΈ GPU worker error for batch {batch_names}: {type(e).__name__}: {e}")# Create zero embeddings for all models in failed batchzero_emb = np.zeros((len(batch_names), model.get_sentence_embedding_dimension()), dtype=np.float32)all_embeddings.append(zero_emb)embeddings = np.vstack(all_embeddings).astype(np.float32)224 unmodified lines}document.getElementById('toggleRed').addEventListener('change', updateVisibility);const HF_LOGO_URI = "static/hf-logo.svg";const graph = __GRAPH_DATA__;const W = innerWidth, H = innerHeight;const svg = d3.select('#dependency').call(d3.zoom().on('zoom', e => g.attr('transform', e.transform)));
modular_graph_and_candidates.py+11-13
hf-logo.svg β static/hf-logo.svgRenamed