Spaces:
Sleeping
Sleeping
Use smaller model
Browse files- README.md +3 -1
- requirements.txt +3 -0
- utils/classify.py +2 -1
README.md
CHANGED
@@ -29,4 +29,6 @@ Using a Zero-Shot Classification model rather than a full LLM introduces a flexi
|
|
29 |
|
30 |
## Optimizations
|
31 |
|
32 |
-
|
|
|
|
|
|
29 |
|
30 |
## Optimizations
|
31 |
|
32 |
+
- more faker function mappings. for the current small model, more mappings for faker functions will most likely be needed.
|
33 |
+
- custom-trained model. A targeted task like this should use a custom model.
|
34 |
+
- custom extensions. For example specify a list of hobbies to randomly select during mock generation.
|
requirements.txt
CHANGED
@@ -5,3 +5,6 @@ faker
|
|
5 |
torch
|
6 |
jsonschema
|
7 |
gradio
|
|
|
|
|
|
|
|
5 |
torch
|
6 |
jsonschema
|
7 |
gradio
|
8 |
+
tiktoken
|
9 |
+
sentencepiece
|
10 |
+
protobuf
|
utils/classify.py
CHANGED
@@ -18,6 +18,7 @@ faker_functions = {
|
|
18 |
"email address": fake.email,
|
19 |
"phone number": fake.phone_number,
|
20 |
"street address": fake.street_address,
|
|
|
21 |
"city name": fake.city,
|
22 |
"state name": fake.state,
|
23 |
"country name": fake.country,
|
@@ -71,7 +72,7 @@ def get_functions_for_descriptions(descriptions):
|
|
71 |
dict: Mapping of descriptions to corresponding mock data functions
|
72 |
"""
|
73 |
# Create pipeline with Facebook's BART model for zero-shot classification
|
74 |
-
pipe = pipeline(model="
|
75 |
|
76 |
# Call pipeline with descriptions and available Faker function labels
|
77 |
result = pipe(descriptions, candidate_labels=list(faker_functions.keys()))
|
|
|
18 |
"email address": fake.email,
|
19 |
"phone number": fake.phone_number,
|
20 |
"street address": fake.street_address,
|
21 |
+
"street": fake.street_address,
|
22 |
"city name": fake.city,
|
23 |
"state name": fake.state,
|
24 |
"country name": fake.country,
|
|
|
72 |
dict: Mapping of descriptions to corresponding mock data functions
|
73 |
"""
|
74 |
# Create pipeline with Facebook's BART model for zero-shot classification
|
75 |
+
pipe = pipeline(model="MoritzLaurer/DeBERTa-v3-xsmall-mnli-fever-anli-ling-binary")
|
76 |
|
77 |
# Call pipeline with descriptions and available Faker function labels
|
78 |
result = pipe(descriptions, candidate_labels=list(faker_functions.keys()))
|