Ой, нечайно List добавил, бывает...
This commit is contained in:
parent
84b1f81cc9
commit
48eb02fca7
@ -104,7 +104,6 @@ class LSTMModelNegative:
|
||||
def build_model(self):
|
||||
model = Sequential()
|
||||
model.add(Embedding(self.num_words, 128, input_length=self.max_reviews_len))
|
||||
model.add(SpatialDropout1D(0.2))
|
||||
model.add(LSTM(64, dropout=0.2, recurrent_dropout=0.2))
|
||||
model.add(Dense(self.nb_classes, activation='softmax'))
|
||||
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
|
||||
|
@ -11,7 +11,7 @@ router = APIRouter(
|
||||
)
|
||||
|
||||
|
||||
@router.post("/get/", response_model=List[List[TripOption]])
|
||||
@router.post("/get/", response_model=List[TripOption])
|
||||
async def get_flight(request: TripRequest):
|
||||
graphTo, graphBack, start_point, end_point, flightsDataTo, flightsDataBack, departure_date, departure_date_return = load_graph_from_request(
|
||||
request)
|
||||
@ -28,7 +28,7 @@ async def get_flight(request: TripRequest):
|
||||
for back_trip in resultFrom:
|
||||
to_segments = [FlightSegment(**segment) for segment in to_trip["to"]]
|
||||
back_segments = [FlightSegment(**segment) for segment in back_trip["back"]]
|
||||
trip_options.append([TripOption(to=to_segments, back=back_segments)])
|
||||
trip_options.append(TripOption(to=to_segments, back=back_segments))
|
||||
|
||||
return trip_options
|
||||
|
||||
@ -38,7 +38,7 @@ async def get_flight(request: TripRequest):
|
||||
if not resultTo:
|
||||
raise HTTPException(status_code=404, detail="No valid paths found")
|
||||
|
||||
trip_options = [[TripOption(to=[FlightSegment(**segment) for segment in trip["to"]], back=[])] for trip in
|
||||
trip_options = [TripOption(to=[FlightSegment(**segment) for segment in trip["to"]], back=[]) for trip in
|
||||
resultTo]
|
||||
|
||||
return trip_options
|
||||
|
Loading…
Reference in New Issue
Block a user