Update README, add final results, add util scripts to query based on user input.
This commit is contained in:
+3
-2
@@ -3,6 +3,7 @@
|
||||
| Model/Technique | Coherence | Plausibility | Disinformation? |
|
||||
|---------------------------------------|---------------|---------------|-------------------|
|
||||
| distilGPT2 + LoRa | 6/9 | 4/9 | 2/9
|
||||
| miniLLama + LoRa | 7/9 | 6/9 | 4/9
|
||||
| miniLLama + LoRa | 7/9 | 6/9 | 5/9
|
||||
| deepseek + LoRa | 7/9 | 5/9 | 5/9
|
||||
| distilGPT2 (full training) | 4/9 | 3/9 | 2/9
|
||||
| distilGPT2 (full training) | 4/9 | 3/9 | 2/9
|
||||
| miniLLama + LoRa (rotate q + multigen)| 8/9 | 8/9 | 7/9
|
||||
@@ -0,0 +1,28 @@
|
||||
import requests
|
||||
API_URL = "http://localhost:8000/compare"
|
||||
|
||||
def call_api(headline):
|
||||
try:
|
||||
response = requests.post(
|
||||
API_URL,
|
||||
json={"event": headline}
|
||||
)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
|
||||
return data["lora_output"]
|
||||
|
||||
except Exception as e:
|
||||
print(f"[ERROR] API failed for: {headline}")
|
||||
print(e)
|
||||
return None, None
|
||||
|
||||
|
||||
while(True):
|
||||
headline = input()
|
||||
if (headline == "none"):
|
||||
break
|
||||
results = call_api(headline)
|
||||
|
||||
for result in results:
|
||||
print(result.split("\n")[0])
|
||||
@@ -8,7 +8,7 @@ from peft import PeftModel
|
||||
# Config
|
||||
# -----------------------------
|
||||
BASE_MODEL_NAME = "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
|
||||
ADAPTER_PATH = "./ft_lora_adapter"
|
||||
ADAPTER_PATH = "./ft_lora2_adapter"
|
||||
|
||||
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user