File size: 1,004 Bytes
9b75985
 
 
 
 
 
47f1d09
fc55c7a
9b75985
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: Pseudoscorex Encoder
emoji: 🧮
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 5.6.0
python_version: "3.12"
app_file: app.py
pinned: false
---

# pseudoscore-x encoder

CodeT5-large encoder with `<criterion>` and `<score>` special tokens added
(matching the training notebook). Returns per-token hidden states for the
backend's scoring head.

## API

```python
from gradio_client import Client

client = Client("YOUR_USERNAME/pseudoscorex-encoder")
out = client.predict("hello world", api_name="/encode")
# out = {
#   "hidden_b64": "<base64 float16 array>",
#   "shape": [512, 1024],
#   "attention_mask": [...],
#   "clean_tokens": [...],
# }
```

## Decoding hidden states

```python
import base64, numpy as np
arr = np.frombuffer(base64.b64decode(out["hidden_b64"]), dtype=np.float16)
arr = arr.reshape(out["shape"])  # (seq_len, 1024)
```

## Hardware

Runs on the free CPU tier. Encoder is loaded once at boot and weights are
frozen, so each request is just a forward pass.