develop #18
|
@ -1,5 +1,5 @@
|
||||||
from langchain_community.llms import Ollama
|
from langchain_community.llms import Ollama
|
||||||
|
import os
|
||||||
|
|
||||||
class ArticleRater:
|
class ArticleRater:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -8,8 +8,12 @@ class ArticleRater:
|
||||||
self.headers = {"Authorization": f"Token {self.token}"}
|
self.headers = {"Authorization": f"Token {self.token}"}
|
||||||
|
|
||||||
def _get_token(self):
|
def _get_token(self):
|
||||||
|
if os.path.exists("Token/Token.txt"):
|
||||||
with open("Token/Token.txt", "r") as t:
|
with open("Token/Token.txt", "r") as t:
|
||||||
return t.readline().strip()
|
return t.readline().strip()
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def get_response(self, article, result, confidence):
|
def get_response(self, article, result, confidence):
|
||||||
ollama_params = {
|
ollama_params = {
|
||||||
"base_url": self.client,
|
"base_url": self.client,
|
||||||
|
|
Loading…
Reference in New Issue