Spaces:
Running
Running
Commit
·
d87e8e8
1
Parent(s):
dc6cd0e
fix: try to fix model and endpoint fetching
Browse files
cloudbuild-endpoint.yaml
CHANGED
|
@@ -31,11 +31,11 @@ steps:
|
|
| 31 |
args:
|
| 32 |
- "-c"
|
| 33 |
- |
|
| 34 |
-
_MODEL_ID=$(gcloud ai models list --region=us-central1 --format="value(name)" | head -n 1)
|
| 35 |
-
_ENDPOINT_ID=$(gcloud ai endpoints list --region=us-central1 --format="value(name)" | head -n 1)
|
| 36 |
-
gcloud ai endpoints deploy-model
|
| 37 |
--region="us-central1" \
|
| 38 |
-
--model
|
| 39 |
--display-name="interview-ai-detector-deployment" \
|
| 40 |
--machine-type="n1-standard-4" \
|
| 41 |
--accelerator="count=1,type=nvidia-tesla-t4" \
|
|
|
|
| 31 |
args:
|
| 32 |
- "-c"
|
| 33 |
- |
|
| 34 |
+
_MODEL_ID=$(gcloud ai models list --region=us-central1 --format="value(name)" | head -n 1) \
|
| 35 |
+
_ENDPOINT_ID=$(gcloud ai endpoints list --region=us-central1 --format="value(name)" | head -n 1) \
|
| 36 |
+
gcloud ai endpoints deploy-model $_ENDPOINT_ID \
|
| 37 |
--region="us-central1" \
|
| 38 |
+
--model=$_MODEL_ID \
|
| 39 |
--display-name="interview-ai-detector-deployment" \
|
| 40 |
--machine-type="n1-standard-4" \
|
| 41 |
--accelerator="count=1,type=nvidia-tesla-t4" \
|
core-model-prediction/hypothesis.py
CHANGED
|
@@ -85,7 +85,7 @@ class BaseModelHypothesis:
|
|
| 85 |
|
| 86 |
def calculate_not_normalized_features(self, text: str) -> List[float]:
|
| 87 |
sentiment_intensity = self.measure_sentiment_intensity(text)
|
| 88 |
-
readability_scores = self.measure_readability(text)
|
| 89 |
perplexity = [self.gemma2bdependencies.calculate_perplexity(text)]
|
| 90 |
burstiness = [self.gemma2bdependencies.calculate_burstiness(text)]
|
| 91 |
features = sentiment_intensity + readability_scores + perplexity + burstiness
|
|
|
|
| 85 |
|
| 86 |
def calculate_not_normalized_features(self, text: str) -> List[float]:
|
| 87 |
sentiment_intensity = self.measure_sentiment_intensity(text)
|
| 88 |
+
readability_scores = [self.measure_readability(text)]
|
| 89 |
perplexity = [self.gemma2bdependencies.calculate_perplexity(text)]
|
| 90 |
burstiness = [self.gemma2bdependencies.calculate_burstiness(text)]
|
| 91 |
features = sentiment_intensity + readability_scores + perplexity + burstiness
|