davidberenstein1957 HF staff commited on
Commit
bcbb85b
1 Parent(s): 71c2318

fix: limit token lengths

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -56,7 +56,7 @@ def vectorize_dataset(split: str, column: str):
56
  global df
57
  global ds
58
  df = ds[split].to_polars()
59
- embeddings = model.encode(df[column], max_length=512 * 4)
60
  df = df.with_columns(pl.Series(embeddings).alias("embeddings"))
61
 
62
 
@@ -153,4 +153,5 @@ with gr.Blocks() as demo:
153
  )
154
 
155
  btn_run.click(fn=run_query, inputs=query_input, outputs=results_output)
 
156
  demo.launch()
 
56
  global df
57
  global ds
58
  df = ds[split].to_polars()
59
+ embeddings = model.encode(df[column], max_length=512)
60
  df = df.with_columns(pl.Series(embeddings).alias("embeddings"))
61
 
62
 
 
153
  )
154
 
155
  btn_run.click(fn=run_query, inputs=query_input, outputs=results_output)
156
+
157
  demo.launch()