Skip to content

Commit

Permalink
Fix lint error
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 661241075
Change-Id: I6908050e002b0663f2abf181126f3e74f9bb957c
  • Loading branch information
jagapiou authored and copybara-github committed Aug 9, 2024
1 parent 0ab7ced commit f86f4de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions concordia/language_model/ollama_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def sample_text(
options={'stop': terminators},
keep_alive='10m',
)
result = response['response']
result = response.response

if self._measurements is not None:
self._measurements.publish_datum(
Expand Down Expand Up @@ -126,9 +126,8 @@ def sample_choice(
format='json',
keep_alive='10m',
)
json_data = response
try:
json_data_response = json.loads(json_data['response'])
json_data_response = json.loads(response.response)
except json.JSONDecodeError:
continue
sample_or_none = json_data_response.get('choice', None)
Expand Down

0 comments on commit f86f4de

Please sign in to comment.